Buy when the stochastic %K (14, 3, 3) climbs back above 20; sell when it reaches 80.
Backtest of Stochastic Oversold on Bank Nifty from Dec 2005 to Nov 2026: CAGR 1.6%, max drawdown 44.7%, win rate 66.7% over 99 trades, vs buy-and-hold 13.1%.
As of · Hypothetical backtest by Jivani Markets on Bank Nifty daily data; re-run weekly
| Measure | Stochastic Oversold | Buy and hold Bank Nifty |
|---|---|---|
| CAGR (annual return) | 1.6% | 13.1% |
| Total return | 38% | 1211% |
| Max drawdown | −44.7% | −68.8% |
| ₹10 lakh became | ₹13.8 lakh | ₹131.1 lakh |
| Win rate | 66.7% | — |
| Trades (closed) | 99 | — |
| Winning / losing trades | 66 / 33 | — |
| Profit factor | 1.22 | — |
| Sharpe ratio | 0.18 | — |
| Volatility (annual) | 17.1% | — |
| Time in the market | 30% | 100% |
| Average holding | 16 sessions | — |
| Charges and slippage paid | ₹5,73,189 | — |
# Stochastic Oversold 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_above(stochastic(14, smooth_k=3, smooth_d=3, output="k"), 80))
buy(crosses_above(stochastic(14, smooth_k=3, smooth_d=3, output="k"), 20), size=percent_of_equity(100))
| Year | Strategy | Buy and hold |
|---|---|---|
| 2026* | +10.7% | +0.3% |
| 2025 | −3.0% | +17.1% |
| 2024 | +8.6% | +5.3% |
| 2023 | −2.9% | +12.3% |
| 2022 | +8.9% | +21.1% |
| 2021 | −6.9% | +13.5% |
| 2020 | +4.3% | −2.8% |
| 2019 | +12.3% | +18.4% |
| 2018 | −6.1% | +6.3% |
| 2017 | +2.9% | +40.5% |
| 2016 | −2.5% | +7.4% |
| 2015 | +12.8% | −9.7% |
| 2014 | +0.6% | +64.6% |
| 2013 | −4.0% | −8.7% |
| 2012 | −1.4% | +56.5% |
| 2011 | −8.4% | −32.4% |
| 2010 | +3.3% | +30.6% |
| 2009 | +20.5% | +80.5% |
| 2008 | −33.7% | −49.3% |
| 2007 | +36.1% | +64.2% |
| 2006 | −1.4% | +31.9% |
| Bought | At | Sold | At | Return |
|---|---|---|---|---|
| 29 Oct 2026 | 54,256.86 | 6 Nov 2026 | 57,726.18 | +6.2% |
| 17 Sept 2026 | 56,210.79 | 19 Oct 2026 | 55,743.71 | −1.1% |
| 7 May 2026 | 56,198.17 | 12 Jun 2026 | 55,850.2 | −0.8% |
| 30 Mar 2026 | 51,605.19 | 13 Apr 2026 | 54,564.03 | +5.5% |
| 23 Dec 2025 | 59,423.35 | 5 Jan 2026 | 60,269.86 | +1.2% |
| 3 Oct 2025 | 55,265.38 | 7 Oct 2025 | 56,042.21 | +1.2% |
| 1 Aug 2025 | 55,980.99 | 17 Sept 2025 | 55,075.61 | −1.8% |
| 6 Mar 2025 | 48,833.14 | 20 Mar 2025 | 49,872.68 | +1.9% |
| 3 Jan 2025 | 51,644.5 | 1 Feb 2025 | 49,518.16 | −4.3% |
| 22 Nov 2024 | 50,588.57 | 28 Nov 2024 | 52,311.36 | +3.2% |
From 30 Dec 2005 to 9 Nov 2026, these Stochastic Oversold rules on the Bank Nifty index returned a CAGR of 1.6% after costs, less than the 13.1% a year from buying and holding the index, with a worst fall of 44.7% against 68.8% for buy-and-hold. It made 99 trades and was invested 30% of the time. This is a hypothetical test on past data, not a recommendation, and past performance is not indicative of future results.
66.7%: 66 of 99 closed trades made money after charges and slippage. On a ₹10 lakh account the average winning trade made ₹31,899 and the average losing trade lost ₹52,292; the profit factor (gross profit ÷ gross loss) was 1.22. A high win rate with small wins can still lose money, so read it with the CAGR and drawdown.
Buy: Stochastic %K crosses above 20. Sell: Stochastic %K crosses above 80. 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 1.6% a year with a worst fall of 44.7%. 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.