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 Sensex from Dec 2005 to Nov 2026: CAGR −1.2%, max drawdown 49.8%, win rate 32.3% over 155 trades, vs buy-and-hold 10.9%.
As of · Hypothetical backtest by Jivani Markets on Sensex daily data; re-run weekly
| Measure | MACD Crossover above the 200-DMA | Buy and hold Sensex |
|---|---|---|
| CAGR (annual return) | −1.2% | 10.9% |
| Total return | −23% | 764% |
| Max drawdown | −49.8% | −60.9% |
| ₹10 lakh became | ₹7.7 lakh | ₹86.4 lakh |
| Win rate | 32.3% | — |
| Trades (closed) | 155 | — |
| Winning / losing trades | 50 / 105 | — |
| Profit factor | 0.89 | — |
| Sharpe ratio | -0.11 | — |
| Volatility (annual) | 8.2% | — |
| Time in the market | 34% | 100% |
| Average holding | 11 sessions | — |
| Charges and slippage paid | ₹7,91,087 | — |
# MACD Crossover above the 200-DMA on Sensex
universe("SENSEX", asset="index")
settings(
timeframe="1d",
entry_timing="next_open",
cost_model="retail",
slippage_model="tiered",
start="2006-01-01",
benchmark="SENSEX",
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* | −3.0% | −4.8% |
| 2025 | −5.6% | +9.1% |
| 2024 | −10.5% | +8.2% |
| 2023 | −0.3% | +18.7% |
| 2022 | +2.2% | +4.4% |
| 2021 | +0.7% | +22.0% |
| 2020 | +1.2% | +15.8% |
| 2019 | −6.2% | +14.4% |
| 2018 | +3.8% | +5.9% |
| 2017 | −1.6% | +27.9% |
| 2016 | −1.6% | +1.9% |
| 2015 | −11.0% | −5.0% |
| 2014 | +3.9% | +29.9% |
| 2013 | −1.4% | +9.0% |
| 2012 | −3.4% | +25.7% |
| 2011 | −4.1% | −24.6% |
| 2010 | +9.1% | +17.4% |
| 2009 | −7.8% | +81.0% |
| 2008 | −16.4% | −52.5% |
| 2007 | +24.1% | +47.1% |
| 2006 | +9.3% | +46.8% |
| Bought | At | Sold | At | Return |
|---|---|---|---|---|
| 4 Feb 2026 | 83,376.94 | 25 Feb 2026 | 82,406.32 | −1.4% |
| 5 Jan 2026 | 85,768.51 | 7 Jan 2026 | 84,493.47 | −1.7% |
| 27 Nov 2025 | 85,873.66 | 3 Dec 2025 | 85,022.91 | −1.2% |
| 18 Nov 2025 | 85,169.93 | 26 Nov 2025 | 84,376.68 | −1.2% |
| 9 Oct 2025 | 82,022.85 | 4 Nov 2025 | 83,874.64 | +2.0% |
| 8 Sept 2025 | 81,025.76 | 26 Sept 2025 | 80,834.57 | −0.5% |
| 19 Aug 2025 | 81,441.09 | 1 Sept 2025 | 79,709.25 | −2.4% |
| 27 Jun 2025 | 83,900.11 | 11 Jul 2025 | 82,696.53 | −1.7% |
| 13 May 2025 | 82,372.98 | 21 May 2025 | 81,205.62 | −1.6% |
| 26 Nov 2024 | 80,536.09 | 19 Dec 2024 | 78,910.49 | −2.2% |
From 30 Dec 2005 to 9 Nov 2026, these MACD Crossover above the 200-DMA rules on the Sensex index returned a CAGR of −1.2% after costs, less than the 10.9% a year from buying and holding the index, with a worst fall of 49.8% against 60.9% for buy-and-hold. It made 155 trades and was invested 34% of the time. This is a hypothetical test on past data, not a recommendation, and past performance is not indicative of future results.
32.3%: 50 of 155 closed trades made money after charges and slippage. On a ₹10 lakh account the average winning trade made ₹36,871 and the average losing trade lost ₹19,708; the profit factor (gross profit ÷ gross loss) was 0.89. 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 Sensex index over the same dates returned 10.9% a year with a worst fall of 60.9%; the strategy returned −1.2% a year with a worst fall of 49.8%. 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.