Take the MACD signal-line cross only while price is above its 200-day average; sell on the cross back.
MACD Crossover above the 200-DMA on Nifty 50 from Dec 2005 to Nov 2026: CAGR −0.5%, max drawdown 38.2%, win rate 33.3% over 150 trades, vs buy-and-hold 11.0%.
As of · Hypothetical backtest by Jivani Markets on Nifty 50 daily data; re-run weekly
| Measure | MACD Crossover above the 200-DMA | Buy and hold Nifty 50 |
|---|---|---|
| CAGR (annual return) | −0.5% | 11.0% |
| Total return | −10% | 783% |
| Max drawdown | −38.2% | −59.9% |
| ₹10 lakh became | ₹9 lakh | ₹88.3 lakh |
| Win rate | 33.3% | — |
| Trades (closed) | 150 | — |
| Winning / losing trades | 50 / 100 | — |
| Profit factor | 0.95 | — |
| Sharpe ratio | -0.02 | — |
| Volatility (annual) | 8.2% | — |
| Time in the market | 32% | 100% |
| Average holding | 11 sessions | — |
| Charges and slippage paid | ₹8,80,572 | — |
# MACD Crossover above the 200-DMA on Nifty 50
universe("NIFTY 50", asset="index")
settings(
timeframe="1d",
entry_timing="next_open",
cost_model="retail",
slippage_model="tiered",
start="2006-01-01",
benchmark="NIFTY 50",
allow_short=False,
participation_ignore_zero_volume=True,
)
exit_when(crosses_below(macd(fast=12, slow=26, signal=9, output="macd"), macd(fast=12, slow=26, signal=9, output="signal")))
buy(all_of(crosses_above(macd(fast=12, slow=26, signal=9, output="macd"), macd(fast=12, slow=26, signal=9, output="signal")), close() > sma(200)), size=percent_of_equity(100))
| Year | Strategy | Buy and hold |
|---|---|---|
| 2026* | −2.8% | −4.2% |
| 2025 | −7.3% | +10.5% |
| 2024 | −13.2% | +8.8% |
| 2023 | 0.0% | +20.0% |
| 2022 | +3.9% | +4.3% |
| 2021 | +3.0% | +24.1% |
| 2020 | +1.6% | +14.9% |
| 2019 | −9.8% | +12.0% |
| 2018 | +2.5% | +3.1% |
| 2017 | 0.0% | +28.6% |
| 2016 | −0.2% | +3.0% |
| 2015 | −7.5% | −4.1% |
| 2014 | +5.7% | +31.4% |
| 2013 | −3.2% | +6.8% |
| 2012 | +0.6% | +27.7% |
| 2011 | −4.1% | −24.6% |
| 2010 | +12.7% | +17.9% |
| 2009 | +3.1% | +75.8% |
| 2008 | −14.1% | −51.8% |
| 2007 | +26.9% | +54.8% |
| 2006 | −1.1% | +39.9% |
| Bought | At | Sold | At | Return |
|---|---|---|---|---|
| 4 Feb 2026 | 25,713.56 | 25 Feb 2026 | 25,474.33 | −1.1% |
| 2 Jan 2026 | 26,194.33 | 9 Jan 2026 | 25,801.64 | −1.7% |
| 24 Dec 2025 | 26,209.91 | 30 Dec 2025 | 25,901.99 | −1.4% |
| 27 Nov 2025 | 26,300.64 | 3 Dec 2025 | 25,965.89 | −1.5% |
| 20 Nov 2025 | 26,171.3 | 26 Nov 2025 | 25,804.18 | −1.6% |
| 9 Oct 2025 | 25,111.91 | 6 Nov 2025 | 25,554.96 | +1.5% |
| 5 Sept 2025 | 24,856.08 | 26 Sept 2025 | 24,781.32 | −0.5% |
| 19 Aug 2025 | 24,928.69 | 1 Sept 2025 | 24,396.05 | −2.4% |
| 27 Jun 2025 | 25,615.02 | 10 Jul 2025 | 25,473.38 | −0.8% |
| 13 May 2025 | 24,901.35 | 22 May 2025 | 24,696.85 | −1.0% |
From 30 Dec 2005 to 9 Nov 2026, these MACD Crossover above the 200-DMA rules on the Nifty 50 index returned a CAGR of −0.5% after costs, less than the 11.0% a year from buying and holding the index, with a worst fall of 38.2% against 59.9% for buy-and-hold. It made 150 trades and was invested 32% of the time. This is a hypothetical test on past data, not a recommendation, and past performance is not indicative of future results.
33.3%: 50 of 150 closed trades made money after charges and slippage. On a ₹10 lakh account the average winning trade made ₹41,029 and the average losing trade lost ₹21,543; the profit factor (gross profit ÷ gross loss) was 0.95. A high win rate with small wins can still lose money, so read it with the CAGR and drawdown.
Buy: The MACD line crosses above its signal line while the close is above the 200-day SMA. Sell: The MACD line crosses back below its signal line. One position at a time with all of the capital; out of the market (in cash, earning nothing) between trades. Daily candles, long only, orders filled at the next session's open.
Buying and holding the Nifty 50 index over the same dates returned 11.0% a year with a worst fall of 59.9%; the strategy returned −0.5% a year with a worst fall of 38.2%. A strategy that is out of the market part of the time usually gives up some return in rising years in exchange for missing part of the falls; the year-by-year table on this page shows where each one gained or lost.
Retail delivery charges (STT, exchange and SEBI fees, stamp duty and GST) and size-based slippage on every buy and sell; signals are read on the daily close and filled at the next session's open; price return only, so dividends are left out of both the strategy and buy-and-hold. An index cannot be bought directly; a fund or ETF that tracks it adds its own expense ratio and tracking error, and pays dividends this price-index test leaves out.
Yes. The "Run it yourself" link opens these exact rules in the Jivani Markets backtest builder, where you can change the indicator settings, add a stop-loss, pick other stocks or indices and re-run it on the latest data.