Register
Learn guide

Avoid Common Errors in Strategy Backtesting

Most backtests that look good fail live, and the reasons repeat. The test used information that was not available at the time, it ignored costs, it was tuned to the data it was tested on, or it covered too few trades to mean anything. This guide lists the common backtesting mistakes, how to spot each one in a report and how to avoid it, with worked examples from Indian index options and futures.

QuantPower Research · Updated 14 Nov 2026 · 18 min read

A backtest is a simulation of what your rules would have done on past prices. Every simulation makes assumptions: about which prices you could have traded at, what it would have cost, and what you knew at each moment. Most backtesting mistakes are assumptions that are kinder than the real market. The fix in each case is the same idea: make the test at least as hard as live trading, so that a strategy which passes has a real chance of surviving. A strict test that rejects a good idea costs you an idea; a lenient test that passes a bad one costs you money.

Backtesting mistakes at a glance

MistakeWhat goes wrongFirst sign in a report
Look-ahead biasThe rules use information not known at the timeResults too good to be true
Ignoring costs and slippageFills at ideal prices with no chargesMany trades, small profit per trade
OverfittingSettings tuned to one stretch of dataOdd settings; result collapses when a setting moves
No unseen testDesigned and judged on the same dataOne period, no split
Too few tradesLuck mistaken for skillFewer than 100 trades
Survivorship biasOnly today's instruments testedStock strategies on today's index list
Wrong or incomplete dataMissing strikes, bad ticks, wrong expiriesTrades at impossible prices
Unrealistic fillsLimits and stops filled exactlyNo loss larger than the planned stop
Ignoring marginSize not limited by marginSame lot count on every day
One kind of marketOnly calm or only trending yearsShort period, no sharp fall
Changing rules mid-testRules edited to remove bad tradesMany reruns, none counted
Rule changes in the marketOld lot sizes, expiry days or taxesResults that span 2024 to 2026 without adjustment
Trusting summary numbersTotals hide the pathOnly CAGR and win rate shown

A short history of the problem

Traders have tested rules on past prices since long before computers, and they have fooled themselves for as long. As computing made it cheap to try thousands of rules, researchers began to measure how often the best-looking result is luck. In 1990 Andrew Lo and Craig MacKinlay showed how "data snooping", choosing what to test after looking at the data, biases results in finance.1 In 1999 Ryan Sullivan, Allan Timmermann and Halbert White tested thousands of simple technical rules on a century of US share prices and found that, once the number of rules tried was taken into account, the apparent edge of the best rule largely disappeared on later data.2

The problem grew with computing power. In 2014 David Bailey, Jonathan Borwein, Marcos López de Prado and Qiji Jim Zhu showed that, with enough trials, it is easy to find a strategy with an excellent backtest that has no edge at all, and proposed ways to measure the probability that a backtest is overfitted.3 At the same time, practitioners collected the everyday errors (stale data, missing costs, fills that could not have happened) into checklists like the one on this page.

Indian traders face an extra layer. Since late 2024 the rules for index derivatives have changed several times: SEBI's framework of 1 October 2024 cut weekly expiries to one per exchange and raised contract sizes from 20 November 2024; the NSE moved its expiries to Tuesday from 1 September 2025; lot sizes changed again from 31 December 2025, to 65 for Nifty and 30 for Bank Nifty; and securities transaction tax on futures and options rose from 1 April 2026.4567 A backtest that spans these dates tests a strategy across several different markets.

1. Look-ahead bias

The strategy uses data that was not known at the moment of the trade. Examples: entering at the open on a signal calculated from the close of the same day; using a candle's high as the entry price when the entry rule depends on the close; using a full day's high and low to set a stop at 10 am; using index constituents or adjusted prices that reflect later events.

How to spot it: results that are too good, especially a high win rate with large average wins, and a strategy that does much worse in Forward test on live prices.

How to avoid it: decide only on closed candles, enter at the next candle or at a price the market actually offered after the signal, and check how your software lines up its data. Our guide to look ahead bias has more examples.

2. Ignoring costs and slippage

The backtest assumes fills at the last traded price with no charges. Live, every trade pays brokerage, STT, exchange transaction charges, SEBI fees, stamp duty and GST, and fills at the bid or the offer rather than the middle. On Nifty options, a round trip costs roughly ₹60 to ₹100 a lot in charges before slippage, and slippage on a market order in a thinly traded strike can be several rupees a unit.

How to spot it: a strategy with many trades and a small average profit per trade. If the average gain is ₹400 a lot and costs are ₹200, half the edge was never there.

How to avoid it: include every charge at the rates for the period tested, and set slippage of at least a tick a leg, more for options away from the money. Then run the test again with double the slippage and see whether the strategy survives.

Worked example: a scalping rule after costs

A rule buys a Nifty option and aims to exit with a ₹4 gain or a ₹4 loss, and wins 55% of the time. Before costs, each lot makes on average 0.55 × 4 × 65 − 0.45 × 4 × 65 = ₹26 a trade.

Now add about ₹70 of charges a round trip and ₹1 a unit of slippage on each side, ₹130 a lot. The average trade becomes 26 − 70 − 130 = −₹174. A rule that looked mildly positive is a steady loser. Strategies with small targets are the most exposed to this mistake, because their costs are large relative to what each trade can make.

3. Overfitting

The rules and settings were chosen because they gave the best result on this data. With enough settings, any price history can be fitted. The fitted strategy learned the noise, which will not repeat.

How to spot it: many settings; unusual values such as RSI(11) or a 37-period average; a sharp drop in results when a setting moves slightly; a Sharpe ratio above 2.

How to avoid it: fewer settings, standard values, and a check that neighbouring values also work. Our guide to avoiding overfitting covers the methods.

Worked example: the stop that only works at one value

A short straddle tested with a 30% stop on each leg shows a good result. The same test at 25% and 35% shows losses. Nothing about the market makes 30% special; the test happened to fall on a few days where that exact level avoided a stop-out. A robust rule shows a broad hill of acceptable results across 25%, 30% and 35%, not a single spike.

4. No test on unseen data

The strategy was designed and tested on the same period. Even without deliberate tuning, choosing rules by looking at a chart is a form of fitting.

How to spot it: a single backtest period with no split between design and checking.

How to avoid it: design on one period and test on another that the strategy has never seen, or use walk-forward testing, which repeats the split across rolling windows.

5. Too few trades

Thirty trades over two years cannot tell skill from luck. A coin-flip strategy wins 18 or more of 30 trades (60% or better) about 18% of the time, nearly one time in five.

How to spot it: fewer than 100 trades, or a result that rests on a handful of large wins.

How to avoid it: test over a longer period or more instruments, and treat strategies with fewer than 100 trades as ideas rather than results.

6. Survivorship bias

The test used only instruments that exist today. Shares that were delisted, merged or dropped from an index are missing, so a strategy that buys weak shares looks better than it was, because the ones that collapsed are not in the data.

How to spot it: a share-selection strategy tested on today's Nifty 50 or today's F&O list, applied to past years.

How to avoid it: use the index members as they were on each date, or restrict the test to index derivatives, where the problem does not arise.

7. Wrong or incomplete data

Option data with missing strikes, candles with bad ticks, unadjusted share prices around splits, or expiry dates that do not match the exchange calendar. Option backtests are especially sensitive: the right expiry, the right strike rule and the right lot size at the time all change the result.

How to spot it: trades at impossible prices, results that change when the data source changes, and lot sizes or expiry days that do not match the period.

How to avoid it: check how the data handles expiries and corporate actions, remove or cap freak ticks, and check a sample of trades against the exchange's own historical data.

8. Unrealistic fills

Limit orders in the backtest fill whenever the price touches the limit, and stops fill exactly at the trigger. Live, a limit order at a touched price may not fill if others are ahead of it in the queue, and a stop fills at the next available price, which in a fast market can be far away.

How to spot it: a backtest with no losing trade larger than the planned stop.

How to avoid it: count a limit fill only when the price trades through the limit by a tick, and add slippage to stop exits. Remember that a candle-based test cannot tell which came first inside one candle, a stop or a target; when both fall inside the same candle, assume the stop.

9. Ignoring margin and position limits

The backtest trades a fixed number of lots regardless of margin. Live, the margin for short options rises on expiry days and after volatile sessions, and exchanges add extra margins in some conditions. A strategy that holds ten lots in the test may be unable to hold five on the day that matters.

How to spot it: position sizes that never change and no margin figure in the report.

How to avoid it: check the peak margin the strategy would have needed, and size to the margin available on the worst day, not the average day.

10. Testing one kind of market

A strategy tested only on calm years has not met a sharp fall or a volatility spike. Short-option strategies look excellent in quiet years and can lose years of gains in weeks like March 2020, or on days like 4 June 2024, when Nifty fell about 6% on election-results day.

How to spot it: a test period shorter than three years, or one without an index fall of at least 10%.

How to avoid it: include periods with different volatility, and look at results year by year and month by month rather than the total.

11. Changing the rules mid-test

Looking at the results, adjusting a rule to remove the worst trades, and running again. Each cycle fits the strategy more closely to this data. This is overfitting by hand.

How to avoid it: write the rules down before the test, count every rerun, and keep a final unseen period untouched until the design is finished.

12. Ignoring rule changes in the market

A Nifty option strategy tested from 2023 to 2026 crosses a change from Thursday to Tuesday expiries, two changes of lot size, the end of weekly expiries on several indices and a rise in STT. A rule that sells options "the day before expiry" trades on Wednesdays in one part of the test and Mondays in another, and its rupee results per lot are not comparable across the lot-size changes.

How to spot it: a test period that spans 20 November 2024, 1 September 2025, 31 December 2025 or 1 April 2026 with no note of the change.

How to avoid it: compare results in per cent of capital or per unit, not per lot; check that expiry-based rules use the real expiry date in every week; and give the most weight to the part of the test that matches today's rules.

13. Trusting the summary numbers alone

The common backtesting mistakes grouped into five families, with how to spot each family in a report (illustration)

A total return and a win rate hide the shape of the result. One large trade can account for most of the profit; a long flat stretch can hide inside a rising three-year curve.

How to avoid it: read the equity curve, the drawdown, the spread of trade results and the results by month. Our guide to backtest performance metrics explains what each number means.

14. Pricing options from a model instead of the market

Some option backtests do not use the options' own traded prices. They take the index price and work out what each option "should" have cost with a pricing model and an assumed volatility. The result can look reasonable and still be far from what the market charged, because real option prices carry a skew (puts away from the money usually cost more than the model's flat volatility suggests), widen before events and collapse after them.

How to spot it: a report that does not say where option prices came from, or one that uses a single volatility figure for every strike and every day.

How to avoid it: prefer tests on each option's own minute prices. Where a model must be used, test the strategy at two or three volatility levels and treat a result that depends on one level as unproven.

15. Ignoring the trading calendar and session times

Holidays, special sessions and changes to trading hours all move the days and minutes a rule acts on. A rule that exits "at 3:25 pm" behaves differently once equity derivatives trade until 3:40 pm, as they have on the NSE since 3 August 2026.9 A rule that enters "on the first trading day of the week" fails silently in holiday weeks if the data skips the day and the test does not notice.

How to spot it: expiry-day or time-based rules with no trades, or with trades on dates when the market was shut.

How to avoid it: use the exchange's own holiday and session calendar for every test date, and re-check time-based exits whenever session times change.

16. Compounding that the market would not allow

A test that reinvests every rupee of profit at once can show a dramatic curve: lots double, then double again. Live, position size is capped by margin, by liquidity in the strikes you trade and by the exchange's freeze quantity for each order. A strategy that trades 2 lots in the first year and 40 lots in the third is not testing the same thing in both years, because 40 lots of a thin strike do not fill at the prices 2 lots did.

How to spot it: an equity curve that bends sharply upward in later years, with lot counts growing every month.

How to avoid it: test at a fixed size first, so each year is judged on the same footing. Add compounding only afterwards, with a cap on lots that the strikes you trade can absorb.

A short routine for every new backtest

  1. Write the rules on paper before opening the software, including size, costs and slippage.
  2. Run the test once at a fixed size, with costs and slippage.
  3. Run it again at double slippage.
  4. Run it at the settings next to yours on each side.
  5. Read the result by month and the trade list, not only the totals.
  6. Judge the unseen part of the period separately.
  7. Count every version you ran, and note it next to the result.
  8. Only then, run it in Forward test for a few weeks.

How the mistakes compound

The mistakes rarely come one at a time. A typical failed strategy has three:

  1. It was tuned on two years of data (overfitting),
  2. with fills at candle prices and no slippage (unrealistic fills and costs),
  3. over a calm period with no sharp fall (one kind of market).

Each mistake alone might shave a few points off the result. Together they can turn a backtest that shows 40% a year into a live strategy that loses. The order of the fixes matters too: fix costs and fills first, because they apply to every trade; then test on unseen data; then judge the settings.

A worked example: one strategy, four honest versions

Take a Nifty futures breakout rule, tested on 15-minute candles with one lot of 65 units. The figures are illustrative.

VersionWhat changedNet result per trade
1. OriginalFills at candle price, no costs, settings tuned on the whole period+₹410
2. Costs addedAbout ₹970 a round trip for one futures lot at April 2026 rates−₹560
3. Costs and one-point slippage each way2 × 65 = ₹130 more a trade−₹690
4. Tuned on the first 70%, judged on the last 30%Settings fixed on the earlier partthe unseen part: −₹820

The rule never had an edge; the first version simply left out what the market charges. Every row is a test you can run in a few minutes, and the sequence is the most useful habit on this page.

A checklist before trusting a backtest

  1. Signals use only data available at the time, on closed candles.
  2. Charges and slippage are included, and the strategy survives double the slippage.
  3. Settings are few and standard, and neighbouring settings also work.
  4. The strategy was tested on data it was not designed on.
  5. At least 100 trades, across several years and more than one kind of market.
  6. The data is complete and correct for expiries, strikes, lot sizes and corporate actions.
  7. Fills are modelled conservatively, and a stop and target inside one candle count as the stop.
  8. Margin on the worst day fits the capital.
  9. Results are compared in per cent of capital across rule changes.
  10. The equity curve and monthly results have been read, not just the totals.
  11. The next step is a Forward test on live prices, not live trading.

How QuantPower's backtests guard against these mistakes

QuantPower runs two kinds of backtest, built around several of these checks:8

  • Closed candles only. Rule backtests act on closed candles from your broker, from 5-minute to daily, up to 2,000 candles a run, one position at a time.
  • Costs in every trade. Brokerage at the rate you set, STT, exchange charges, SEBI fees, stamp duty and GST are deducted from each trade, and the report shows gross profit, charges and net profit side by side.
  • Slippage you choose, applied to every fill. Running the same test again with only the slippage changed is free, so testing at double slippage costs nothing extra.
  • No invented data. If your broker has no candles for the period, the test says "Data is not available" and stops.
  • Unseen days. Option strategy backtests hold back the last 30% of trading days and compare them with the first 70%, with a plain verdict.
  • Plain warnings. The report adds notes when the test covers fewer than 60 days, when the worst day took back more than half the profit, when unseen days are weaker, or when charges take more than 40% of the gross profit.
  • Forward test next. Any algo can run in Forward test on live prices with test money, using the same engine, before it trades live.

A backtest costs 2 tokens a run, with the first 10 each week free.

Start with 500 free tokens

Connect your broker, build a strategy and test it on paper before a single live order goes out.

Where backtesting practice is going

Testing is getting cheaper and faster, and that makes discipline more important. When an AI assistant can write and test fifty versions of a strategy in a minute, the best of the fifty is very likely to be luck, so tools are adding guards by default: held-back unseen periods, warnings written from the numbers, and reports that show how many versions were tried. In India, the frequent changes to expiries, lot sizes and taxes since 2024 are pushing traders to read results in per cent and by period, rather than as one rupee total across years that no longer resemble today's market.

Frequently asked questions

Why does my strategy work in backtesting but not in live trading?

Usually one of four reasons: look-ahead bias in the test, costs and slippage left out, settings tuned to the test period, or fills modelled too kindly. A few weeks of Forward test on live prices, compared with the backtest for the same days, usually shows which.

Is a backtest with no losing months a warning sign?

Usually, yes. Real strategies have bad months. A long run with none often means look-ahead bias, fills modelled too kindly, or settings tuned to that period. Read the trade log for the best months first.

Do more conditions make a backtest more reliable?

Usually the opposite. Each extra condition removes some losing trades from the past, so the result improves, but it also leaves fewer trades and more ways to have fitted the noise. A rule with three conditions and 300 trades is easier to trust than one with eight conditions and 40.

Should I include the years before the 2024 to 2026 rule changes?

Yes, but read them separately. Older years show how the rules behave in different markets; recent years show how they behave under today's expiries, lot sizes and taxes. Give the recent part the most weight.

How many versions of a strategy can I test before the result means nothing?

There is no fixed number, but the more versions you try, the more the best one owes to luck. Write down how many you tried, keep the last part of the period unseen until the design is finished, and expect the unseen result to be weaker than the best in-sample one.

Can backtesting guarantee future profits?

No. A clean backtest shows that the rules had an edge in the past, under the test's assumptions. It does not show that the conditions behind that edge will continue.

References

  1. A. W. Lo and A. C. MacKinlay, "Data-Snooping Biases in Tests of Financial Asset Pricing Models", *Review of Financial Studies* 3(3), 431–467 (1990)
  2. R. Sullivan, A. Timmermann and H. White, "Data-Snooping, Technical Trading Rule Performance, and the Bootstrap", *Journal of Finance* 54(5), 1647–1691 (1999)
  3. D. H. Bailey, J. M. Borwein, M. López de Prado and Q. J. Zhu, "Pseudo-Mathematics and Financial Charlatanism: The Effects of Backtest Overfitting on Out-of-Sample Performance", *Notices of the American Mathematical Society* 61(5), 458–471 (2014)
  4. SEBI, circular "Measures to strengthen Equity Index Derivatives framework for increased investor protection and market stability", 1 October 2024 (sebi.gov.in)
  5. NSE, circular on the revision of expiry days of derivatives contracts, effective 1 September 2025 (nseindia.com)
  6. NSE, circular on the revision of lot sizes of index derivatives, effective 31 December 2025 (nseindia.com)
  7. Union Budget 2026-27: securities transaction tax on futures and options raised from 1 April 2026 (indiabudget.gov.in)
  8. QuantPower: backtest engines, charges, slippage and report warnings, from the app's code, checked 12 November 2026
  9. NSE, circular extending equity derivatives trading hours to 3:40 pm from 3 August 2026 (nseindia.com)
Backtested results are hypothetical and do not represent actual trading. Trading involves substantial risk; this page is for education and is not investment advice.