What is Backtesting?
Reviewed by Karthikeyan Anbarasan (Founder, TradeLyser) · Updated 19 Oct 2026 · Editorial policy
How to run a backtest
- Write the rules so that two people would take the same trades: the trigger, the stop, the target or exit, the size and the hours.
- Choose data that matches the trade: intraday candles for an intraday setup, option prices per strike and expiry for an option strategy.
- Cover different conditions, such as trending, ranging and high-volatility periods, not just the last good stretch.
- Record every simulated trade with its entry time, price, exit and result, exactly as you would in a live journal.
- Apply charges and slippage to each trade, then work out expectancy, win rate, profit factor and max drawdown.
Biases that flatter a backtest
Look-ahead bias
Survivorship bias
Overfitting
Costs a backtest must include
| Cost | How it applies (NSE, from 1 April 2026) |
|---|---|
| STT | Options: 0.15% of the sell-side premium. Futures: 0.05% of the sell side |
| Exchange charges | Options 0.03553% of premium; futures 0.00183% of turnover |
| Brokerage and GST | Your broker’s rate per order, plus 18% GST on brokerage and exchange charges |
| Stamp duty | Buy side only: options 0.003%, futures 0.002% |
| Slippage | The gap between the signal price and a realistic fill; larger on fast moves and thin strikes |
Illustrative: a strategy averaging +₹650 per trade gross over 120 trades shows +₹78,000. With ₹80 of charges and ₹55 of slippage per trade, it makes +₹515 per trade, or +₹61,800 in total.
Reading the results
| Metric | Same backtest, net (illustrative) | What to ask |
|---|---|---|
| Trades | 120 | Enough to judge? Under 30 is a rough read only |
| Win rate | 50% (60 wins, 60 losses) | Does it hold in each year, or come from one period? |
| Average win / average loss | ₹2,530 / ₹1,500 | Is the payoff realistic for the stops and targets used? |
| Expectancy | +₹515 per trade | Still positive after charges and slippage? |
| Profit factor | ₹1,51,800 ÷ ₹90,000 = 1.69 | Does it fall sharply out of sample? |
Check the arithmetic both ways: 60 × ₹2,530 = ₹1,51,800 won and 60 × ₹1,500 = ₹90,000 lost gives +₹61,800, which matches 120 × ₹515. Also look at the worst losing streak and the max drawdown against your daily and weekly limits; a strategy that would have broken your loss limits in the test will break them live.
Testing out of sample
- Split the history before you start: build the rules on the earlier part, for example the first two years, and set the last year aside.
- Fix the rules and parameters, then run them once on the held-back year.
- Compare expectancy, win rate and max drawdown between the two periods. A large drop suggests the rules were fitted to the first period.
- Paper trade or trade small size live, and journal those trades under the same strategy tag so they can be compared with the backtest.
Backtest
Paper or forward test
Small live size
Reference guide
| Context | Value | Reading |
|---|---|---|
| Tested on data it was not tuned on | More dependable | Out-of-sample results close to in-sample suggest the rules are not just fitted to the past |
| Fewer than 30 trades | Too small to judge | After 30 trades a 50% win rate still has a range of about ±18 points |
| Gross P&L only | Overstated | Add brokerage, STT, exchange charges, GST, stamp duty and slippage before trusting it |
Questions
Is backtesting reliable?
Only as reliable as the data, the cost assumptions and the number of trades. A backtest that includes charges and slippage, avoids look-ahead bias and holds up out of sample is a reasonable starting point, not a promise of live results.
How many trades does a backtest need?
At least 30 for a rough read, and closer to 100 or more before trusting the numbers. With 30 trades, a 50% win rate still has a range of about ±18 points.
What is the difference between backtesting and paper trading?
Backtesting runs rules over past data; paper trading runs them in the live market without real money. Paper trading catches things a backtest misses, such as hesitation and missed entries, but neither shows your real fills.
Should a backtest include STT and brokerage?
Yes. From 1 April 2026, STT is 0.15% of the sell-side premium on options and 0.05% of the sell side on futures, before brokerage, exchange charges, GST and stamp duty. On frequent intraday strategies, these can decide whether the result is positive.
Can I backtest options strategies in India?
Yes, but it needs historical prices for each strike and expiry, not just the index. Check that the data follows the contract rules of each period, such as expiry days and lot sizes, and assume worse fills on strikes that trade thinly.
What is a good backtest result?
There is no single number. Look for positive expectancy after charges and slippage over 100 or more trades, a drawdown your limits could survive, and out-of-sample results that stay reasonably close to the in-sample ones.