Learn · Guide · 9 min read
200-day moving average on Nifty, midcaps and smallcaps: 20 years after tax
We tested the 200-day moving average on seven Nifty indices over 20 years, after charges and tax. It halved every crash but lost to buy and hold on large caps.
The 200-day moving average is the best-known trend filter there is. Hold the index while it closes above its 200-day average and step aside when it closes below. Most backtests of it show a chart with no charges and no tax. We tested it on seven Nifty indices for 20 years, with real charges, today's tax rules and a fill you could actually get.
I tried moving average crossovers in the past. What I eventually realised was that the edge was in the trend-following trade management, letting winners run and cutting the rest, and not in the entries the crossovers gave me. This test found the same.
On the Nifty 50 the 200-day rule kept 7.4% a year after tax, against 10.3% for buy and hold. On the Smallcap 250 it kept 11.9% against 11.5%, roughly a tie. On every index it cut the worst fall by about half, from 60% to 77% down to 30% to 38%.
All figures here are hypothetical backtest results, not a recommendation. Past results do not predict future ones.
The rules we tested
Buy an index ETF on a daily close above the 200-day simple moving average. Sell on a close below it. While out, hold a liquid fund.
We also tested 100, 150 and 250 days, each with a buffer of 0% to 3% around the average to cut false signals, and the 50/200 golden cross, which buys when the 50-day average rises above the 200-day.
How we tested it
- We used daily prices of seven Nifty indices from April 2006 to 9 October 2026, 20.5 years. The period covers 2008, 2020 and the smallcap crash of 2018. Index values come from the stocks that were in the index each day, so they have no survivorship bias.
- The account starts with ₹10 lakh. It is fully invested when the rule says in and fully in cash when it says out.
- Every trade fills at the close of the day after the signal, with 0.1% slippage on every buy and sell. The signal needs the day's close, and the index close is only known after the market shuts. Most backtests fill at the signal day's close, and we show below what that does.
- While invested, the account earns the index's dividends, which we put at 1.3% a year for the Nifty 50 and 0.7% for smallcaps, less an ETF expense ratio of 0.04% to 0.25%. While out, cash earns 6% a year, taxed at 30% as a liquid fund's gains are.
- Every trade pays Zerodha's current charges for ETF delivery. There is no brokerage, but there are exchange charges, stamp duty, GST and the DP charge.
- Tax follows today's rules for the whole period. A gain held under a year is short-term and taxed at 20%. A longer hold is long-term and taxed at 12.5% above ₹1.25 lakh a year. We set off losses and carried them forward as the rules allow.
Results on every index
| Index | Buy and hold | 200-day rule | Worst fall, buy and hold | Worst fall, 200-day rule |
|---|---|---|---|---|
| Nifty 50 | 10.3% | 7.4% | −60% | −30% |
| Nifty 500 | 10.8% | 7.8% | −64% | −33% |
| Nifty Next 50 | 12.7% | 10.8% | −72% | −35% |
| Nifty Midcap 150 | 13.0% | 12.0% | −73% | −38% |
| Nifty Midcap 100 | 12.9% | 11.5% | −69% | −38% |
| Nifty Smallcap 250 | 11.5% | 11.9% | −76% | −38% |
| Nifty Smallcap 100 | 9.9% | 10.5% | −77% | −37% |
Yearly return after charges and tax.
We tried 16 settings on each index, four averages with four buffers. On the Nifty 50 and Nifty 500 none of them beat buy and hold. On the Midcap 150, 4 of 16 did. On the Smallcap 250, 12 of 16 did, and on the Smallcap 100, 15 of 16.
The golden cross did worse than the plain 200-day rule on every index. Waiting for one average to cross another gets you out later, so its worst falls were 38% to 55%.
The Nifty 50, layer by layer
| 200-day rule on the Nifty 50 | Yearly return | Worst fall |
|---|---|---|
| Price index only, no costs | 6.7% | −32% |
| Plus dividends while in, cash yield while out | 9.5% | −30% |
| Less charges and slippage | 8.5% | −30% |
| Less tax, which is what you keep | 7.4% | −30% |
| Buy and hold, taxed on selling at the end | 10.3% | −60% |
| 72% Nifty, 28% liquid fund, rebalanced each April, after tax | 9.2% | −46% |
The rule traded about 4 times a year and was invested 72% of the time. A fixed 72% in the Nifty, with no timing at all, kept 1.8% a year more than the rule. The rule's advantage is the smaller fall, 30% against 46%.
Tax took 1.1% a year, because nearly every exit is a short-term gain or a loss. Charges and slippage took another 1%. Our Supertrend test found the same pattern on the Nifty 50, with the faster indicator keeping a little more.
Why smallcaps look different
The Smallcap 250 fell 76% from its 2008 peak. The 200-day rule was out for most of that fall and lost 31% in 2008 against 69% for the index. Most of the rule's lead comes from that one year.
| Smallcap 250 | 2006 to 2016 | 2016 to 2026 |
|---|---|---|
| Buy and hold | 8.0% | 14.4% |
| 200-day rule | 11.0% | 13.1% |
| Worst fall, buy and hold | −76% | −60% |
| Worst fall, 200-day rule | −38% | −28% |
In the first decade the rule kept 3 points a year more. In the second it kept 1.3 points less, though it still halved the worst fall. The Midcap 150 shows the same split, ahead by 3.5 points from 2006 to 2016 and behind by 4 points from 2016 to 2026.
Smallcap index prices also flatter any trend rule. Many smallcaps trade thinly, and a stock that doesn't trade near the close carries an old price into the index. The index then catches up over the next day or two, so today's move partly predicts tomorrow's. Over the last ten years the Smallcap 250's daily returns had a correlation of 0.13 with the next day's, against −0.04 for the Nifty 50.
A backtest that fills at the signal day's close books that catch-up as profit, though no one could trade at those prices. Filling a day later, as we did above, removes most of it.
| Fill | Nifty 50 | Midcap 150 | Smallcap 250 |
|---|---|---|---|
| Signal day's close, as most backtests show | 7.2% | 14.1% | 14.3% |
| Next day's close, as in this test | 7.4% | 12.0% | 11.9% |
On the Nifty 50 the delay makes no difference. On the Smallcap 250 it costs 2.4% a year.
The best-looking setting is the least trustworthy. A 100-day average on the Smallcap 250 kept 18.7% a year with same-day fills and 16.2% with next-day fills. Each extra day of delay took more away, down to 12.2% when filled five days after the signal. A return that shrinks the longer you wait is what the index's lagging prices produce. You couldn't have checked it on a real fund either. No ETF tracked a smallcap index in 2008, and the Smallcap 250 ETF in our data has under three years of history. Our backtest checklist asks whether a strategy could have been traded at the prices it assumes.
Entries or exits
We tested which half of the rule does the work. Each line below is after tax with next-day fills.
| Version | Nifty 50 | Midcap 150 | Smallcap 250 |
|---|---|---|---|
| The 200-day rule | 7.4% | 12.0% | 11.9% |
| Random entries, 200-day exit | 6.3% | 9.5% | 9.6% |
| 200-day entries, sold after 120 days | 7.4% | 7.6% | 7.1% |
| 200-day entries, sold after 20 days | 5.8% | 5.6% | 3.5% |
Random entries are the median of 200 runs.
On midcaps and smallcaps, keeping the 200-day exit and buying on random days cost about 2.5% a year. Keeping the 200-day entry and dropping the exit cost 4.4% to 4.8% a year at best. The exit, which sells when the trend breaks and holds for as long as it lasts, added more than the entry did. On the Nifty 50 neither half beat buy and hold.
The profits also came from a few trades. With the 200-day rule, the best 10% of trades made more than the whole strategy did on every index. The other 90% lost money between them. On the Nifty 50 that was 8 trades out of 81.
What we checked
- Raising slippage from 0.1% to 0.3% a trade cut the Nifty 50 result from 7.4% to 5.8% and the Smallcap 250 result from 11.9% to 10.8%.
- A 3% buffer around the average cut trading on the Nifty 50 from about 4 times a year to under once and added 1.2% a year, to 8.6%. That is still below buy and hold. The 16 settings ranged from 7.3% to 9.2%.
- The 2020 crash was short. The rule sold in late February or early March and bought back in July or August, and it beat buy and hold that year on the Nifty 50 and the Smallcap 250. In 2018 it lost on the Nifty 50, down 5% against up 4%.
What this test does not tell you
- We applied today's tax rules to all 20 years. Long-term gains on equity were tax-free until 2018, so buy and hold did better than shown here.
- The dividend and cash yields are flat averages. Actual yields rose and fell over the 20 years.
- We tested each index on its own. A rule that switches between indices, or adds a market breadth filter, needs its own test. Our guide to market breadth explains that kind of filter.
- No fund existed for most of these indices in 2006. The results show what the rule did on the index, not what any investor could have earned at the time.
On the Nifty 50 the 200-day average is a way to own less of the market during long falls, and it costs about 3% a year after tax. On smallcaps it roughly kept pace with buy and hold while halving the worst fall, but most of that came from 2008 and from index prices no fund could trade at.
Keep reading
This is general education about trading methods. It is not advice to buy or sell any security.