Home / Strategy lab
Strategy lab
Loading data…
Test a strategy
Run simple trading rules on NIFTY 50 history and compare them with buying and holding.
Strategy return–
Buy and hold–
Worst drawdown–
Trades–
Growth of ₹1
StrategyBuy and holdDrawdownTest period:
Year by year
Thick bar: strategy. Thin bar: buy and hold.
Index-level test on NIFTY 50 prices: signals at the close, trades at the next open, long only, no leverage, no options, no taxes. Cost is charged on every buy and every sell. Dividends are not included, so buy and hold is slightly understated. Past results do not predict future results. This is an educational tool, not investment advice.
How the test works
- Data: NIFTY 50 daily open, high, low and close from Yahoo Finance (^NSEI), checked against NSE's daily index files, with missing sessions filled from NSE. History starts in 2009 so the averages are ready by the first test year.
- Trading: each rule is checked at the day's close and any buy or sell happens at the next day's open. The test starts with no position on the first trading day of the chosen year. When in a trade, all the money is in the index; otherwise it sits in cash earning nothing.
- Trend following: simple moving averages of the close. In the market whenever the fast average is above the slow one.
- Dip buying: Wilder's RSI of the close. Buy when it closes below "Buy below", sell when it closes above "Sell above".
- Breakout: buy when the close is above the highest high of the previous N days; sell when the close is below the lowest low of the previous M days.
- Buy and hold: buys at the first open of the chosen year (paying the cost once) and holds to the latest close.
- Numbers: a yearly rate is the compound annual growth rate. Worst drawdown is the largest fall from a peak, measured on daily closes. A trade still open at the end is valued at the latest close. Invested is the share of trading days spent in the market.