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 Bank Nifty from Dec 2005 to Nov 2026: CAGR −0.9%, drawdown 44.6%, win rate 33.1% over 142 trades, vs index 13.1%.
As of · Hypothetical backtest by Jivani Markets on Bank Nifty daily data; re-run weekly
| Measure | MACD Crossover above the 200-DMA | Buy and hold Bank Nifty |
|---|---|---|
| CAGR (annual return) | −0.9% | 13.1% |
| Total return | −18% | 1211% |
| Max drawdown | −44.6% | −68.8% |
| ₹10 lakh became | ₹8.2 lakh | ₹131.1 lakh |
| Win rate | 33.1% | — |
| Trades (closed) | 142 | — |
| Winning / losing trades | 47 / 95 | — |
| Profit factor | 0.94 | — |
| Sharpe ratio | -0.04 | — |
| Volatility (annual) | 10.7% | — |
| Time in the market | 29% | 100% |
| Average holding | 11 sessions | — |
| Charges and slippage paid | ₹7,82,813 | — |
# MACD Crossover above the 200-DMA on Bank Nifty
universe("NIFTY BANK", asset="index")
settings(
timeframe="1d",
entry_timing="next_open",
cost_model="retail",
slippage_model="tiered",
start="2006-01-01",
benchmark="NIFTY BANK",
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* | −7.4% | +0.3% |
| 2025 | −3.4% | +17.1% |
| 2024 | −9.1% | +5.3% |
| 2023 | −5.6% | +12.3% |
| 2022 | −2.2% | +21.1% |
| 2021 | −1.2% | +13.5% |
| 2020 | +13.4% | −2.8% |
| 2019 | +7.5% | +18.4% |
| 2018 | −4.3% | +6.3% |
| 2017 | +4.3% | +40.5% |
| 2016 | −6.1% | +7.4% |
| 2015 | −20.0% | −9.7% |
| 2014 | +11.2% | +64.6% |
| 2013 | −12.3% | −8.7% |
| 2012 | +7.2% | +56.5% |
| 2011 | −15.9% | −32.4% |
| 2010 | +9.5% | +30.6% |
| 2009 | +22.2% | +80.5% |
| 2008 | −8.2% | −49.3% |
| 2007 | +9.9% | +64.2% |
| 2006 | +2.5% | +31.9% |
| Bought | At | Sold | At | Return |
|---|---|---|---|---|
| 1 Sept 2026 | 57,646.64 | 2 Sept 2026 | 56,920.94 | −1.5% |
| 13 Aug 2026 | 57,885.85 | 14 Aug 2026 | 57,503.37 | −0.9% |
| 6 Aug 2026 | 57,901.72 | 12 Aug 2026 | 57,305.71 | −1.3% |
| 5 Feb 2026 | 60,405.82 | 2 Mar 2026 | 59,115.49 | −2.4% |
| 5 Jan 2026 | 60,450.94 | 12 Jan 2026 | 59,128.42 | −2.4% |
| 28 Nov 2025 | 59,848.34 | 3 Dec 2025 | 59,069.96 | −1.5% |
| 19 Nov 2025 | 58,996.51 | 25 Nov 2025 | 58,837.26 | −0.5% |
| 3 Oct 2025 | 55,265.38 | 4 Nov 2025 | 57,879.7 | +4.5% |
| 11 Sept 2025 | 54,494.67 | 30 Sept 2025 | 54,623.44 | +0.0% |
| 20 Aug 2025 | 55,835.13 | 28 Aug 2025 | 54,174.62 | −3.2% |
From 30 Dec 2005 to 9 Nov 2026, these MACD Crossover above the 200-DMA rules on the Bank Nifty index returned a CAGR of −0.9% after costs, less than the 13.1% a year from buying and holding the index, with a worst fall of 44.6% against 68.8% for buy-and-hold. It made 142 trades and was invested 29% of the time. This is a hypothetical test on past data, not a recommendation, and past performance is not indicative of future results.
33.1%: 47 of 142 closed trades made money after charges and slippage. On a ₹10 lakh account the average winning trade made ₹56,200 and the average losing trade lost ₹29,647; the profit factor (gross profit ÷ gross loss) was 0.94. 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 Bank Nifty index over the same dates returned 13.1% a year with a worst fall of 68.8%; the strategy returned −0.9% a year with a worst fall of 44.6%. 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.