20/50 EMA crossover
Be invested while the 20-day EMA is above the 50-day EMA. Step out when it crosses below.
₹1 lakh in NIFTY50, Nov 2011 → Nov 2026
19 Nov 2011 → 19 Nov 2026The idea
Moving-average crossovers are the classic trend-following tool. The 20-day exponential average reacts fast, the 50-day slowly. When the fast line is above the slow one, the short-term trend is up, so you hold. No targets, no stop-loss: the crossover is the exit.
The rules
- Buy
- 20-day EMA is above the 50-day EMA
- Sell
- 20-day EMA falls below the 50-day EMA
- Size
- All capital; idle cash earns 6%
₹1 lakh in NIFTY 50. Hold it while the 20-day EMA is above the 50-day EMA, sell when it crosses below. Idle cash earns 6%, 0.2% cost per trade. Compare with buy and hold over the last 15 years.
Test it in the LabVerdict across 10 stocks and indices
One stock can flatter any rule. The same rules on more names show whether it is an edge or luck.
EMA 20/50 trend: on average 6.67 points a year worse than buy & hold on XIRR, with a worst fall 13.3 points smaller.
| Stock / index | Buy & hold | EMA 20/50 trend | Trades | Won | Time in market | ||
|---|---|---|---|---|---|---|---|
| XIRR | Worst fall | XIRR | Worst fall | ||||
| NIFTY50 | 11.8% | −38.4% | 10.4% | −18.6% | 25 | 60% | 69% |
| BANKNIFTY | 14.2% | −47.9% | 10.0% | −21.6% | 31 | 48% | 67% |
| RELIANCE | 15.3% | −45.1% | 5.7% | −41.7% | 46 | 28% | 57% |
| HDFCBANK | 15.3% | −41.1% | 7.9% | −39.2% | 35 | 43% | 67% |
| ICICIBANK | 19.3% | −51.5% | 10.6% | −36.4% | 34 | 50% | 66% |
| TCS | 12.9% | −53.4% | 2.3% | −48.0% | 41 | 34% | 64% |
| INFY | 11.1% | −48.2% | 4.7% | −36.1% | 31 | 29% | 61% |
| SBIN | 15.2% | −59.5% | 4.8% | −47.2% | 36 | 33% | 61% |
| ITC | 9.2% | −55.3% | 8.8% | −34.3% | 33 | 33% | 57% |
| LT | 16.2% | −54.4% | 8.5% | −39.1% | 33 | 33% | 65% |
Each row is a separate backtest, 19 Nov 2011 → 19 Nov 2026. Green marks the best value in the row. Worst fall is the maximum drawdown: the largest drop from a peak in portfolio value.
Real trades, real dates
From the NIFTY50 backtest above: the median winner and loser. Exits are checked on closing prices, so a gap can push a loss past the stop-loss.
A typical winning trade
₹3,18,407 in → ₹3,39,097 out · +6.5% after costs
A typical losing trade
₹3,26,525 in → ₹3,15,475 out · −3.4% after costs
Last 8 trades
| Bought | Price | Sold | Price | Days | Result |
|---|---|---|---|---|---|
| 3 Jul 2026 | ₹24,270.85 | 7 Sep 2026 | ₹23,779.15 | 66 | −2.4% |
| 15 Sep 2025 | ₹25,069.2 | 21 Jan 2026 | ₹25,157.5 | 128 | −0.0% |
| 22 Apr 2025 | ₹24,167.25 | 8 Aug 2025 | ₹24,363.3 | 108 | +0.4% |
| 21 Nov 2023 | ₹19,783.4 | 25 Oct 2024 | ₹24,180.8 | 339 | +21.7% |
| 26 Apr 2023 | ₹17,813.6 | 27 Oct 2023 | ₹19,047.25 | 184 | +6.5% |
| 19 Oct 2022 | ₹17,512.25 | 12 Jan 2023 | ₹17,858.2 | 85 | +1.6% |
| 26 Jul 2022 | ₹16,483.85 | 14 Oct 2022 | ₹17,185.7 | 80 | +3.8% |
| 4 Apr 2022 | ₹18,053.4 | 4 May 2022 | ₹16,677.6 | 30 | −8.0% |
Tends to work
- Long, smooth trends in indices
- Bear markets: it steps aside and avoids the deepest part of a fall
Tends to fail
- Sideways markets, where the lines cross back and forth (whipsaws)
- V-shaped recoveries: it re-enters late, after much of the bounce
Make it yours
Click one to open it in the Lab, or write your own twist in plain English.
Assumptions and the exact spec the engine ran
- ₹1,00,000 invested once; each trade uses all available cash
- 0.2% cost on every buy and every sell (STT, brokerage, exchange charges, stamp duty)
- Cash waiting between trades earns 6% a year, like a liquid fund
- Prices are daily closes; indices are price indices (no dividends), stock prices include dividends
- Taxes are not deducted
- Signals are filled at the next day's close.
- The stock list is today's, so stocks that were delisted or shrank are missing (survivorship bias).
{
"title": "EMA 20/50 trend: NIFTY50",
"years": 15,
"cost_pct": 0.2,
"assumptions": [
"₹1,00,000 invested once; each trade uses all available cash",
"0.2% cost on every buy and every sell (STT, brokerage, exchange charges, stamp duty)",
"Cash waiting between trades earns 6% a year, like a liquid fund",
"Prices are daily closes; indices are price indices (no dividends), stock prices include dividends",
"Taxes are not deducted"
],
"strategies": [
{
"name": "Buy & hold",
"symbol": "NIFTY50",
"contribution": {
"amount": 100000,
"every": "once"
},
"buy": {
"when": "on_contribution"
}
},
{
"name": "EMA 20/50 trend",
"symbol": "NIFTY50",
"contribution": {
"amount": 100000,
"every": "once"
},
"cash_interest_pct": 6,
"buy": {
"when": "signal",
"check": "daily",
"condition": {
"type": "ma_cross",
"fast": 20,
"slow": 50,
"ma": "ema",
"op": ">",
"value": 0
},
"amount": "all_cash"
},
"sell": {
"check": "daily",
"condition": {
"type": "ma_cross",
"fast": 20,
"slow": 50,
"ma": "ema",
"op": "<",
"value": 0
},
"fraction": 1
}
}
]
}
Keep researching
All strategiesGolden cross (50/200 SMA)
Hold while the 50-day average is above the 200-day. The slow, famous one.
The 200 DMA switch
Own the index above its 200-day average. Sit in a liquid fund when it closes 2% below.
RSI oversold bounce
Buy when RSI(14) drops below 30. Book 8% profit or cut the loss at 5%.