GithubHelp home page GithubHelp logo

algorithmic-trading's Introduction

Trading Strategies for NIFTY Data Analysis

This project includes the implementation of various trading strategies to analyze NIFTY data from 26th October 2020 to 18th January 2021. The strategies that have been implemented are as follows:

Strategy 1: Bollinger Method

This strategy is based on the Bollinger Bands indicator, which helps to identify potential buying and selling opportunities in the market. The upper and lower bands are drawn around a simple moving average, and when the price crosses the upper or lower band, it is considered to be overbought or oversold, respectively.

Strategy 2: Buy and Hold

The Buy and Hold strategy involves buying a security and holding it for a long period of time, regardless of market conditions. This project uses the Buy and Hold strategy as a benchmark to compare the performance of other trading strategies.

Strategy 3: EMA Crossover

This strategy is based on the crossover of two exponential moving averages (EMA) with different time periods. A bullish crossover is generated when the shorter EMA crosses above the longer EMA, and a bearish crossover is generated when the shorter EMA crosses below the longer EMA.

Strategy 4: Fixed Stop Loss and Take Profit Percentage

In this strategy, a fixed percentage is set for the stop loss and take profit levels. When the price reaches the take profit level, the trade is closed, and when it reaches the stop loss level, the trade is also closed. This strategy helps to minimize losses and maximize profits.

Strategy 5: Previous Day High/Low Breakout

This strategy involves analyzing the previous day's high and low prices to determine potential buying opportunities. If the price of the current day crosses the high of the previous day, a "Buy" signal is generated, and 10 stocks are bought at that price. The target price is set at the Buy price plus the difference between the previous day's high and low, and the stop loss is set at the Buy price minus one-fourth of the difference between the previous day's high and low. Once the target or stop loss level is reached, the trade is closed, and the signal becomes inactive until another buying opportunity arises.

Strategy Profit/Loss ROI
Buy and Hold Rs 2287350 19.20%
Previous Day High/Low Breakout Rs 1528400 12.83%
Fixed Stop Loss (1%) and Take Profit (2%) Percentage Rs -54801.75 -0.46%
Fixed Stop Loss (1%) and Take Profit (5%) Percentage Rs 1480599.50 12.43%
Fixed Stop Loss (1%) and Take Profit (10%) Percentage Rs 610549.75 5.12%
Exponential Moving Average Crossover Rs 499652.34 4.20%
Bollinger Bands Rs 3864846.68 32.45%

Assumptions:

  • The initial investment is considered to be Rs 11,918,000, which is the equivalent of 1000 trades of Nifty stocks at the first tick data price.
  • All profits and losses are calculated based on this initial investment.

algorithmic-trading's People

Contributors

aggarwal-aditya avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.