Most backtests look beautiful until the market opens on a gap day. Then the equity curve takes a hit that wasn't in the report. The strategy didn't break — the assumption that "fills happen at the next candle" did.
If you trade NIFTY, BANKNIFTY, or single stocks in India, gap risk is the single most under-modelled cost in retail algo workflows. Let's break down why backtests routinely understate it, and what to fix before you push a system live.
What "gap risk" actually means in Indian markets
A gap is any jump between yesterday's close and today's open where price doesn't trade through the intermediate levels. In India, you typically see four flavours:
- Overnight gaps: US market moves, crude, dollar, and overnight news between 3:30 PM IST close and 9:15 AM IST open.
- Event gaps: RBI policy, Budget, election results, US Fed, geopolitics.
- Earnings gaps: Single stocks moving 5–15% on results.
- Pre-open gaps: The 9:00–9:15 AM pre-open session sets the open, and your stop from yesterday may already be breached before the first candle prints.
The problem isn't that gaps exist. The problem is that retail backtesting tools usually assume your stop-loss, target, or exit logic gets executed at the level you specified. In a gap, that's not true.
Why backtests systematically understate gap risk
Stop-losses get treated as guaranteed fills
Most retail backtest engines execute a stop at the stop price, not at the next available traded price. On a gap day, that's a fantasy. If your stop is at 22,400 and NIFTY opens at 22,250 on a US selloff, your real fill is closer to 22,250 — not 22,400. That's a 150-point slippage the backtest never recorded.
Multiply this across a year of trades and you can wipe out 20–40% of reported edge on overnight-holding systems.
Limit orders don't fill the way the report says
Backtest engines often assume any price touched is a fill. In real markets, on a violent open, your buy-limit at 22,300 might never fill because the market gapped past it and never came back. Conversely, a sell-limit that "filled" in backtest may have only printed once with no quantity at your level.
Candle-based backtests hide intra-candle damage
If your backtest uses 5-minute candles, the first candle of the day already includes the gap. Your strategy "sees" the open and exits in the same candle. In reality, between 9:15 and 9:20 AM, price can swing 200 points on BANKNIFTY before any clean signal forms. Slippage in this window is real and ugly.
This is one of the options backtest data assumptions that quietly destroys edge — especially on systems that hold positions overnight or scale in near the open.
Option premiums gap harder than the underlying
A 1% gap in NIFTY can be a 30–60% gap in an ATM weekly option premium, and a 100%+ gap in OTM strikes. If your backtest models option exits using last-traded-price at candle close, you're missing the most violent part of the move. For short premium systems, this is where ruin scenarios live.
A simple test: re-run your backtest with a gap penalty
Before trusting any system, apply a crude gap stress test:
- Identify every trade that was open across the close (overnight) or that entered in the first 15 minutes.
- Apply a 0.3% slippage on index futures, 0.5–1% on liquid stocks, and 5–10% on option premiums for those fills.
- Recompute the equity curve.
If your strategy still works, you're in better shape than most. If it collapses, you've found the real risk — not the one the original report showed.
Practical guardrails for live execution
You can't avoid gaps, but you can stop pretending they don't happen.
Don't hold overnight unless the system was designed for it
Intraday systems that occasionally "let a winner run" past 3:30 PM are silently taking gap risk they were never tested for. Either build a positional system from scratch with gap-aware sizing, or square off cleanly. No exceptions.
Cap position size to a tolerable gap loss
Ask: if the underlying gaps 2% against me, what's the rupee loss? If that number is more than 2–3x your average daily risk, the position is too large. This single sizing rule does more for survival than any stop-loss logic. Practical risk management at the portfolio level beats any single-trade stop.
Add a pre-open gap filter
If pre-open suggests a gap of more than 0.75% on NIFTY or 1% on BANKNIFTY against your open positional bias, either skip new entries or reduce size. You can codify this in a no-code strategy builder as a gating condition before the entry block runs.
Treat the first 5–10 minutes as a separate regime
Spreads are wider, slippage is higher, and signals that look clean on a 5-minute chart are often noise. Many serious traders skip entries before 9:30 AM and exits before 9:25 AM. Backtest with and without this filter — the difference is usually instructive.
Use a scanner to flag pre-market context
Before market open, check the gap behaviour of your watchlist using a stock scanner — overnight ADR, SGX NIFTY, sectoral leaders. If the broader setup is gappy, dial down aggression that day.
What a gap-aware live workflow looks like
A realistic execution stack for an Indian retail algo trader:
- Backtest with conservative slippage on first-candle entries and overnight exits.
- Forward-test in paper trading for at least 4–6 weeks to see actual fills on gap days.
- Run a hard daily loss cap that auto-disables the system.
- Keep position size such that a 2% adverse gap is survivable.
- Log every gap-day fill manually and compare to backtest assumptions monthly.
If you want to set this up properly without writing custom code, you can try the early access workflow and wire up entry filters, position sizing, and execution guardrails in one place.
Gap risk checklist before going live
- Did I stress-test the backtest with extra slippage on gap days?
- Are overnight positions sized for a 2% adverse gap?
- Does my system skip or reduce entries on large pre-open gaps?
- Am I avoiding stop-loss assumptions on the first 5-minute candle?
- For option systems, did I model a 30%+ premium gap, not just an index move?
- Is there a daily loss cap that disables the strategy automatically?
- Have I forward-tested through at least one event day (RBI, Fed, results)?
A strategy that survives this list is rare. That's the point. Gap risk is the cost most retail backtests refuse to charge — and the market eventually collects it anyway.



