Tutorial
How to Backtest an Options Trading Strategy
12 min read · Updated 2 Nov 2026
If you trade options without backtesting, you are paying for tuition in real money. Backtesting is how you find out - using years of real NSE data - whether your idea would have worked, before the market tells you the same thing more expensively.
This tutorial walks through a complete options backtest end-to-end. We use a Bank Nifty weekly short straddle as the worked example because it's a strategy retail traders run constantly, and because the back-testing logic exposes every gotcha - strike selection, leg legging, expiry handling, stop-loss, re-entry. By the end you'll know how to set up, run, and read the results of any options backtest.
What you'll need before you start
Three things. None of them are optional.
- An options backtesting platform with real option chain data - strike-level, going back at least 5 years. We'll use Unfluke's Basic Backtester in the screenshots and steps, but the workflow translates to any platform with similar capabilities.
- A clearly defined strategy. "Sell straddles" is not a strategy. "Sell ATM straddle on Bank Nifty at 9:20 AM every Thursday morning, exit at 3:20 PM or stop-loss at 30% premium move" is a strategy. Specificity is the whole game.
- Honest evaluation criteria. Decide before you see results what would make you trade this strategy and what wouldn't. Otherwise you'll talk yourself into bad equity curves.
Step 1 - Define the strategy precisely
Our worked example: Bank Nifty weekly short straddle, entered Thursday 9:20 AM, ATM strikes on both call and put, exited at 3:20 PM same day or on a 30% combined premium increase (stop-loss).
Translate that into the seven decisions every options backtest needs:
- Instrument: BANKNIFTY weekly options
- Leg 1: Sell 1 lot ATM CE
- Leg 2: Sell 1 lot ATM PE
- Entry time: Thursday 09:20 IST
- Exit time: Thursday 15:20 IST
- Stop-loss: 30% increase in combined premium
- Date range: 01 Jan 2022 to 31 Dec 2024 (3 years, multiple regimes)
Notice: every decision is unambiguous. There's no "around 9:20" or "near the money". Ambiguity in the definition becomes noise in the result.
Step 2 - Set up the backtest in Unfluke
Open Basic Backtester → New Strategy. Pick BANKNIFTY, weekly expiry. Add two legs: leg 1 SELL CE ATM, leg 2 SELL PE ATM. Set entry to "Thursday 09:20" and exit to "Thursday 15:20 OR combined SL 30%". Set date range to 01-Jan-2022 to 31-Dec-2024.
Two things to watch for:
- Strike selection mode. "ATM" can mean "closest strike to spot at entry" or "rounded ATM by 100 points". The difference is small but meaningful on big-move days. Unfluke defaults to "closest", which matches what a human trader would actually do.
- STT and brokerage modelling. Both should be on. If you switch them off, your backtest P&L will overstate returns by ~15-30% on this strategy specifically - options STT is brutal on the sell side.
Run.
Step 3 - Read the results without lying to yourself
The results page shows the equity curve, max drawdown, win rate, avg win, avg loss, profit factor, and a trade-by-trade log. Don't start with the headline number. Start with these three:
- Max drawdown. If your max drawdown is bigger than your year's expected P&L, this strategy will blow you up emotionally even if it's profitable on paper.
- Win-rate vs avg-win/avg-loss ratio. A 70% win-rate strategy with avg-loss 3x avg-win is the classic straddle profile. One losing day eats three winning days. Make sure you can stomach the variance.
- Trade distribution. Were profits concentrated in a 6-month window? Did the strategy stop working after a regime change? An equity curve that's flat for 18 months is tradeable. One that goes parabolic and then dies is data-mining.
On this particular setup, the 2022-24 Bank Nifty short straddle shows a positive expectancy but a max drawdown that surprises most first-time backtesters. That's the value of the exercise - you find out before you trade.
Step 4 - Iterate on parameters, not on the idea
Now tweak. Try entry at 9:30 instead of 9:20. Try stop-loss at 25% and 40%. Try OTM straddle instead of ATM. Each variant is a new backtest - and a chance to over-fit.
The rule: change one variable per iteration. If you change three things and the result improves, you don't know which change mattered. You're also one step closer to a strategy that works on your backtest sample and nothing else.
A clean iteration log looks like:
- v1 - baseline: ATM, 9:20 entry, 30% SL → X% return, Y% drawdown
- v2 - change entry to 9:30 → result
- v3 - change SL to 25% → result
- v4 - change SL to 40% → result
After ~5 iterations, stop. The point isn't to find the backtest-perfect parameters - it's to find a strategy whose performance is stable across reasonable parameter variations. If a 5% change in stop-loss kills your edge, you don't have an edge; you have noise.
Step 5 - Walk-forward test
Now the hardest step: split your data. Backtest only on 2022-2023. Pick the best version. Then test that version, unchanged, on 2024. If it survives, you have a candidate. If it doesn't, you over-fit.
This is called walk-forward testing and it's the closest thing to an honest verdict you can get without trading live. Most retail traders skip it because their first-pass results look good. Most retail strategies blow up because they skipped it.
Aim for at least one out-of-sample year per backtest. Two is better.
Common backtesting mistakes (and how to avoid them)
- Look-ahead bias - using data the strategy couldn't have known at the time. E.g. exiting at a price set by next bar's close. Modern platforms guard against this, but custom logic can sneak it in.
- Survivorship bias - backtesting only on stocks that exist today. The 200 names that got delisted because they went to zero aren't in your sample, so your backtest is too optimistic. (Less of a problem for index-and-F&O strategies.)
- Optimistic slippage - assuming you can fill at the printed close. In illiquid options or high-volatility opens, real slippage is 5-15%.
- Over-fitting - see the iteration section. The more parameters you tune, the more you're modelling the past rather than the underlying edge.
- Cherry-picking date ranges - choosing the window where your strategy worked. Always test on multiple regimes.
Strategy ideas (ideas, not promises)
These are ideas to study, paper-trade and backtest, not recommendations or signals, and not a promise of any result. A good backtest describes the past; it does not promise the next expiry. Size, entries, exits and risk are your own decisions.
1. Start from a plain baseline
- Setup: a simple, fully specified rule, such as a weekly ATM short straddle entered at a fixed time with a fixed stop.
- Use: every later version is judged against this baseline, so you know what each change bought you.
2. Change one thing at a time
- Idea: vary only the entry time, or only the stop, or only the wings, and rerun after each change.
- Invalidation: if results jump around with small parameter changes, the edge is fragile and likely curve-fitted.
3. Naked against hedged
Run the straddle and an iron fly with the same entry. Compare not only P&L but the worst day and the drawdown: the hedge often costs a little return to remove the days that end accounts.
4. Keep the last stretch for later
Tune on the earlier years only, then run the final version once on the held-back period (the walk-forward step above). If it falls apart there, go back to the idea, not the parameters.
How to test these
Do all four in Unfluke's backtester with costs on, export the trade list for each run, and keep notes of what changed between runs.
Honest caveats
A perfect backtest doesn't make a profitable trader. The gap between "this strategy worked on paper" and "I traded it successfully" is filled with execution discipline, position sizing, and the willpower not to deviate when 3 losing days in a row arrive. Backtesting tells you the strategy is tradeable. It doesn't tell you you are.
Past performance does not guarantee future returns.
Where to go from here
Read the deeper overview of how our backtesters work in our Strategy Backtesting piece, or jump straight in and sign up free to run your own first options backtest. If you want to focus on a specific index, see Bank Nifty Backtesting or Nifty Backtesting.
More from the blog
- Strategy Backtesting on Unfluke
Backtest trading strategies on real Indian market data with Unfluke. Test equity, Nifty, Bank Nifty and options strategies with realistic costs and key metrics.
- Live Market Scanners
Explore Unfluke's real-time stock scanner for NSE markets. Scan 1,800+ stocks with 40+ technical indicators, fundamental filters, F&O data and custom rules.
- Option Strategy Simulator
Build and simulate multi-leg options strategies with Unfluke. Visualize payoffs, Greeks, max profit and loss, and replay historical option data from 2023.