QuantsappFaster in the app: live data, alerts, tradingOpen
Log inStart free
Futures · technicalPositionalNIFTYlow complexity

RSI divergence swings

RSI divergence is one of the most quoted reversal signals in technical analysis: price makes a new low but momentum does not, or price makes a new high while RSI fails to. This version trades it on hourly NIFTY futures bars, waits until each swing point is confirmed so the signal cannot repaint, and holds the position positionally with a 2% stop and a 4% target.
Buys or sells NIFTY futures when a confirmed hourly swing shows RSI divergence, then holds for days until a 2% stop or 4% target.
Market viewFades moves (mean reversion)
TradesNIFTY near-month futures, held for days
RiskOpen-ended (loss not capped by the structure)
CapitalFutures margin
SuitsIntermediate
Trades a month1.6
Typical hold12 days
Profitable months6 of 12
Longest losing run4 trades
Made money inIndia VIX above 14.5 at entryEntries on sessions that closed above their open
Lost money inEntries on sessions that closed below their open
Default settings
Symbol
Bar minutes
RSI period
Swing window
SL %
Target %
Direction
Roll time
Lots
Backtest this strategy →Change any setting, pick your own period and run it in the Quantsapp web app. Backtesting is part of the Max plan. Pro+ members can use it now as a free trial.
1

How it trades

What it trades
Universe
NIFTY Positional · 1 Oct 25 → 30 Sep 26
Enters
Next tick after an hourly swing confirms an RSI(14) divergence
Legs
BUY FUT · Near month · Current month (rolled at expiry) · 1 lotSELL FUT · Near month · Current month (rolled at expiry) · 1 lot
Exits
stop 2% of the entry price against the tradetarget 4% of the entry price in favourroll closed 15:15 on futures expiry, reopened next open
Re-entry
Next divergence after the trade closes; one position at a time
Bars
BAR_MINUTES bars of the near-month future anchored at 09:15 (the last bar of a session is shorter), continuous across sessions, back-adjusted at each futures roll (below). RSI(RSI_PERIOD), Wilder.
Swings
a swing low is a bar whose low is below the lows of the SWING_WINDOW bars on each side; it is known only when the SWING_WINDOW-th bar after it closes (no repainting). Swing highs likewise.
Entry
when a swing low is confirmed and its price low is below the previous swing low while its RSI is above the RSI at that previous swing low (regular bullish divergence) -> buy LOTS of the near-month future at the first tick after the confirming bar closes. A higher swing high with a lower RSI high -> sell. DIRECTION "both" | "long_only" | "short_only". One position at a time; a signal while in a trade is ignored.
Stop
SL_PCT % of the entry price against the trade.
Exit
TP_PCT % of the entry price in favour. No time exit. Both are counted on the whole trade across rolls.
Roll
on the futures expiry day an open trade is closed at ROLL_TIME ("monthly roll") and re-opened in the new near month at the next session's first tick.
2

Results

PRE-BUILT · DEFAULTS
NIFTY · 2025-10-01 → 2026-09-30 · 19 trades · before costs
Net P&L+₹64,758
Win rate42%
Max drawdown−₹96,283
Avg per trade+₹3,408
Profit factor1.25
Worst trade−₹55,906
3

Where it made and lost money

With 19 trades, most conditions have too few trades to judge. Two splits have enough. Entries made after India VIX closed above 14.5 earned ₹31,207 over 8 trades, more than calmer days, since divergences after a volatile fall had room to rebound 4%. Trades opened on sessions that closed above their open made ₹1,27,209 over 11 trades, while those opened on down sessions lost ₹62,451 over 8. In practice the year's profit came from long trades that caught rallies; the small samples on trend direction and holding-period moves point the same way but cannot be read as a rule.

Session direction on the entry day
NIFTY closed above its open+₹1,27,20911 trades45% won
NIFTY closed below its open−₹62,4518 trades38% won
India VIX the evening before
VIX below 11.5 (calm)+₹14,9063 trades33% won
VIX 11.5-14.5 (normal)+₹18,6458 trades38% won
VIX above 14.5 (nervous)+₹31,2078 trades50% won
Kind of session on the entry day
Quiet session (range under 0.75%)−₹60,9326 trades33% won
Trend day (closed near the high or low)+₹1,65,7176 trades67% won
Choppy day (wide range, closed mid-range)−₹40,0277 trades29% won
Market while the trade was held
NIFTY rose over 1% while held+₹1,44,7705 trades80% won
NIFTY within ±1% while held−₹71,6725 trades0% won
NIFTY fell over 1% while held−₹8,3348 trades50% won
How the entry day opened
Gap up of 0.4% or more+₹68,32511 trades45% won
Flat open+₹35,1535 trades40% won
Gap down of 0.4% or more−₹38,7203 trades33% won
Trend going in
Uptrend (NIFTY above its 20-day average)+₹51,8506 trades50% won
Downtrend (NIFTY below its 20-day average)+₹12,90813 trades38% won
Expiry day (NIFTY weekly)
Expiry day−₹31,8502 trades0% won
Other days+₹96,60817 trades47% won
Day of the week
Monday+₹40,6252 trades50% won
Tuesday−₹61 trades0% won
Wednesday+₹47,61612 trades42% won
Thursday+₹6,7733 trades67% won
Friday−₹30,2501 trades0% won
The same trades, split by the market conditions around each entry, before costs.
4

About this strategy

  1. Build 60-minute bars of the near-month NIFTY future from 09:15, joined across sessions and adjusted for the price jump at each monthly roll. Compute RSI(14) on them.
  2. A swing low is a bar whose low is below the five bars on either side; it is only known once the fifth bar after it has closed. Swing highs are the mirror.
  3. Bullish divergence: a newly confirmed swing low is lower than the previous swing low, but RSI at it is higher. Buy one lot of the future at the next tick.
  4. Bearish divergence: a new swing high above the previous one with a lower RSI. Sell one lot.
  5. Exit at a 2% loss or a 4% gain on the entry price, whichever comes first. There is no time exit.
  6. On the monthly futures expiry, an open trade is closed at 15:15 and reopened in the next month at the next open, with the stop and target still counted on the whole trade.
  7. Only one position at a time; signals that arrive while a trade is open are ignored.

Why traders use it

Divergence suggests the push behind a move is fading even though price has not yet turned, so it offers an early entry against a tired trend. The 2:1 target-to-stop ratio means the strategy can be wrong more often than right and still come out ahead. Hourly bars filter out intraday noise while keeping enough signals in a year, and confirming swings before acting avoids the repainting problem that makes many chart-based divergence indicators look better than they are.

Works best whenIn this test, entries made after India VIX closed above 14.5 and on sessions that closed above their open, typically bullish divergences after a fall that turned into a multi-day rally. Most other conditions had too few trades to judge.
Struggles whenIn this test, trades opened on sessions that closed below their open lost ₹62,451 over 8 trades. Counter-trend entries during persistent moves, and holds where NIFTY went nowhere until the stop, also appear in the losers, though those samples are small.

The year in plain words

On NIFTY futures from 1 Oct 2025 to 30 Sep 2026 with default settings, the strategy logged 19 trades (each monthly roll counts as a separate trade) and won 42% of them, making ₹64,758 before costs with a profit factor of 1.25. The swings were large: the best trade made ₹81,915 in October, while September lost ₹86,210 and the maximum drawdown reached ₹96,283. Seven trades ended at the 2% stop, four at the 4% target and seven at a monthly roll. After ₹20 per order and bid-ask slippage the profit was ₹46,556. The year's profit came from a few big wins.

What the settings do

Bar minutesThe length of each bar. Shorter bars give more, smaller swings and more trades; longer bars give fewer, more significant divergences.RSI periodThe number of bars in the RSI. A shorter RSI swings more and produces more divergences; a longer one is smoother.Swing windowHow many bars on each side a swing must stand out from, from 3 to 10. A larger window finds only major swings and confirms them later.SL %The stop, as a percentage of the entry price. On NIFTY at around 25,000 the default 2% is roughly 500 points.Target %The target, as a percentage of the entry price. A higher target lets winners run further but is reached less often.DirectionTrade both bullish and bearish divergences, or only one side.Roll timeThe time on the futures expiry day when an open position is closed so it can be reopened in the next month.

Risks

  • A 2% stop on one NIFTY futures lot is a large loss per trade: six of the seven stopped trades in this test lost ₹30,000 or more, the largest ₹55,906.
  • Positions are held overnight and over weekends, so gaps can fill the stop well beyond 2%.
  • With about 19 trades a year, one or two outcomes decide the result; the year's best trade alone exceeded the total profit.
  • Counter-trend entries in a strong trend can be stopped out several times in a row.

Who it suits

Swing traders with margin for a NIFTY futures position held for days, who can tolerate drawdowns near ₹1 lakh per lot and long gaps between signals. It fits those who prefer few, rule-based trades to daily intraday activity.

5

Questions traders ask

What is RSI divergence?

Bullish divergence is when price makes a lower low but RSI makes a higher low, hinting that selling pressure is weakening. Bearish divergence is a higher price high with a lower RSI high. Traders read both as early signs that the current move may reverse.

Is the RSI divergence strategy profitable on NIFTY?

In this backtest on NIFTY futures from 1 Oct 2025 to 30 Sep 2026 it made ₹64,758 before costs and ₹46,556 after ₹20 per order and bid-ask slippage, but with a maximum drawdown of ₹96,283 and only 19 trades. Statutory charges were excluded. Past results do not guarantee future ones.

Why does RSI divergence repaint on charts?

Many chart scripts mark a swing low as soon as a bar looks like the lowest, then move or delete the mark if price goes lower. That makes past signals look cleaner than they were in real time. This version only acts once five bars after the swing have closed, so every signal was known at the time of entry.

Which timeframe is best for RSI divergence?

There is no single answer; this backtest uses 60-minute bars as a middle ground between noisy intraday swings and rare daily ones. You can change “Bar minutes” and “Swing window” to test other timeframes and see how the number and quality of signals change.

6

Before you rely on it

ADAPTED FOR TODAY'S NSE RULES- The source does not fix a timeframe; 60-minute bars of the index future are the spec's interpretation, with the fill at the next bar's open after confirmation (the first real tick). - The rolled future jumps by the next month's basis at every expiry. The bar history is back-adjusted by that basis (next minus near month at ROLL_TIME on the expiry day, from the futures curve), so swings compare like with like. Where the curve has no next month that day the roll cannot be measured: then no divergence whose two swings straddle that roll is traded. Stops and targets are on real prices. - The time between the two swings is not limited (the source compares the last two swings).
WATCH OUTdivergences must only be signalled after the swing is confirmed - many chart scripts repaint; this one waits SWING_WINDOW bars. Gross of costs.
Also known asRSI divergence
Backtests run on historical NSE data with fills at the last traded price. "Before costs" excludes brokerage, taxes and slippage. Quantsapp is not recommending any strategy; it is just a backtesting utility. Past results are not a promise of future returns.

Log in or sign up

Enter your mobile number. New to Quantsapp? The same OTP creates your free account.

+91

By continuing you agree to the Terms of Use and Privacy Policy.