Backtesting Without Fooling Yourself: A NIFTY Options Case Study on Costs and Overfitting
A backtest is a story about the past that we hope will repeat. We ran a widely traded NIFTY options strategy through three and a half years of minute-by-minute data to show how quickly a profitable-looking backtest falls apart once costs and honest testing are added.
Key takeaways
- A 9:20 ATM short straddle with a 25% stop loss per leg made ₹95,543 per lot over 831 trading days before costs (January 2023 to May 2026, 1-minute data).
- Adding brokerage and statutory charges of ₹40 per lot per order turned it into −₹37,417. Adding 0.5% slippage made it −₹1,34,262.
- Of 56 parameter settings tested, the best one in 2023-2024 earned almost nothing in 2025-2026. Ranking settings by past results did not predict future results.
- The biggest backtest errors are look-ahead bias, ignoring costs and slippage, overfitting parameters, and testing on too short or too favourable a period.
- A backtest can reject a bad idea cheaply. It can rarely prove a good one. Treat any backtest that looks smooth with suspicion.
Every week, social media shows backtests of options strategies with smooth, rising equity curves. Most of them would not survive contact with a real brokerage account. The reasons are well understood by professional quants, and they are worth learning before you risk money on any rule-based strategy.
To make the lessons concrete, we tested one of the most widely traded retail strategies in India, the intraday NIFTY short straddle, using our own backtesting engine and NSE option prices at one-minute resolution. We report what we found, including the parts that do not flatter the strategy.
This is an educational case study about method. Selling options carries large risks, and SEBI's data shows most individual F&O traders lose money. Nothing here suggests you should trade this or any strategy.
The strategy and the data
- Rules: each trading day at 09:20, sell one lot each of the at-the-money NIFTY call and put of the nearest weekly expiry. Each leg has a stop loss at 25% above its entry price. Any open leg is closed at 15:15.
- Data: one-minute NSE prices for NIFTY options and the index, January 2023 to May 2026, 831 trading days.
- Execution model: entries at the 09:20 price; stops checked against every one-minute bar's high, filled at the stop price (or the bar's open if it gapped past); exits at the 15:15 price.
- Lot size: the lot size in force for each expiry: 50 until April 2024, 25 for the rest of 2024, 75 through 2025 and 65 from January 2026. Rupee results per lot are therefore not comparable across years; what matters below is the comparison between scenarios and settings over the same days.
Result 1: costs turn a winner into a loser
| Scenario | Net P&L per lot | Win rate | Worst day | Max drawdown |
|---|---|---|---|---|
| Before any costs | ₹95,543 | 54.2% | −₹8,025 | −₹41,490 |
| With ₹40 per lot per order for brokerage and charges | −₹37,417 | 52.7% | −₹8,185 | −₹68,412 |
| With charges and 0.5% slippage on every fill | −₹1,34,262 | 51.6% | −₹8,546 | −₹1,46,695 |
Before costs, the straddle made ₹95,543 per lot over three and a half years, an average of ₹115 a day. That edge is thin. Each day the strategy places at least four orders (two entries, two exits), and stopped-out legs add none, so ₹40 per lot per order is roughly ₹160 a day, more than the average gross profit. Slippage, which is very real at 09:20 when spreads are wide and in fast markets when stops trigger, adds more.
From 1 April 2026, STT on options sales rose from 0.1% to 0.15% of the premium, which raises the charges further for any strategy that sells options frequently.
Result 2: the "best" parameters were an illusion
A natural next step is to optimise: try different stop losses and entry times and pick the best. We tested 56 combinations (stop loss of none, 10%, 15%, 20%, 25%, 30%, 40% or 50%; entry at 09:20, 09:30, 10:00, 10:30, 11:00, 12:00 or 13:00), all with ₹40 per lot per order in charges, on 5-minute data for speed. We chose settings using only 2023-2024 (in-sample) and then checked how they did in 2025 to May 2026 (out-of-sample), data the selection never saw.
| In-sample rank | Stop loss | Entry | 2023-2024 P&L | 2025-May 2026 P&L |
|---|---|---|---|---|
| #1 | 10% | 11:00 | ₹37,842 | ₹54 |
| #2 | 40% | 13:00 | ₹33,862 | −₹6,969 |
| #3 | 20% | 11:00 | ₹31,390 | ₹3,493 |
| #4 | 15% | 11:00 | ₹27,880 | ₹11,599 |
| #5 | 20% | 10:00 | ₹20,558 | ₹51,709 |
The best in-sample setting (10% stop, 11:00 entry) made ₹37,842 in 2023-2024, then ₹54 in the following 17 months, ranking 45 of 56 out of sample. Of the 18 settings that were profitable in-sample, 15 were also profitable out of sample. The rank correlation between in-sample and out-of-sample results was 0.05, where 1 would mean the past ranking perfectly predicted the future and 0 would mean no relationship at all.
(Because the lot size was larger in 2025-2026, rupee amounts in the two periods are not directly comparable; the rankings within each period are, since every setting faced the same lot sizes.)
This is overfitting. With many parameters and a limited history, some combination will always look good by chance. The more combinations you try, the better the best one looks, and the less it means.
The six classic backtesting mistakes
1. Look-ahead bias
Using information that would not have been available at the time of the decision: the day's closing price to decide a morning entry, a stock's future index membership, or revised financial data. Check that every input to a decision is dated before the decision.
2. Ignoring costs and slippage
As Result 1 shows, costs can be larger than the edge. Model brokerage, STT, exchange charges, GST and stamp duty, then add slippage, especially for options at the open and for stop-loss exits in fast markets.
3. Overfitting
Tuning parameters until the past looks perfect. Keep rules simple, prefer parameters that work across a broad range of values rather than one sharp peak, and always reserve data you never touch until the final test.
4. Too short or too friendly a period
A strategy that sells volatility looks wonderful in calm years and can lose months of profit in a single day of crisis. Test across different regimes: trending and range-bound markets, low and high volatility, and events such as March 2020.
5. Unrealistic fills
Assuming you sell at the last traded price, or get filled at a stop exactly when the market jumped through it. Prefer bid/ask-aware fills, or at least assume fills at the worse of the stop and the next available price.
6. Survivorship and selection bias
Testing only on stocks that exist today ignores those that were delisted or went bankrupt. For index options this matters less, but for stock strategies it can inflate results substantially.
A checklist for any backtest you see or run
- Are all costs and a realistic slippage included? What happens if you double them?
- Was the strategy designed on one period and tested on another it never saw?
- How many variations were tried before this one was shown?
- Does it survive small changes to its parameters (entry time, stop size)?
- What was the worst day, the worst month and the maximum drawdown, and could you have lived through them with real money?
- How many trades does it rest on? A few dozen is not evidence.
- Does it depend on a few huge days? Remove the best five days and look again.
- Is the position size consistent with your capital and risk per trade? See our position sizing guide.
What a backtest is good for
None of this means backtesting is useless. It is excellent at rejecting ideas cheaply: if a strategy loses money in a careful backtest with realistic costs, it will almost certainly lose money live. It is also the right way to understand a strategy's behaviour: how often it loses, how deep its drawdowns go, and how sensitive it is to costs. What a backtest cannot do is promise future profits. Markets change, and the more a result depends on precise tuning, the less likely it is to last.
Frequently asked questions
What is a short straddle?
Selling both a call and a put option at the same (at-the-money) strike. The seller collects two premiums and profits if the index stays near the strike; losses grow if it moves sharply in either direction. It is a high-risk strategy that needs margin.
Why use 1-minute data?
Stop losses and targets are triggered inside a bar. With 5- or 15-minute bars, a backtest cannot tell whether a price touched the stop before or after the target. One-minute data narrows that uncertainty, though even it cannot show every tick.
What counts as realistic costs for NIFTY options?
Brokerage (often ₹20 per order with discount brokers), securities transaction tax (0.15% of premium on the sell side from 1 April 2026), exchange transaction charges, SEBI fees, stamp duty and 18% GST on brokerage and exchange charges. For a one-lot ATM order, these commonly add up to a few tens of rupees. Slippage, the gap between the price you expect and the price you get, is often larger.
Is this a recommendation to trade or avoid straddles?
Neither. It is an illustration of backtesting method. SEBI's own studies show that most individual F&O traders lose money; see our analysis of the SEBI data.
Sources and further reading
This article is for education only and is not investment, tax or legal advice. Tax rules quoted are for the tax year 2026-27 (FY 2026-27) unless stated, and can change; check the latest position with the Income Tax Department or a qualified professional before acting. Examples use assumed returns that are not guaranteed.
