Guide · Systematic

Backtesting integrity: the eight ways a backtest lies

The short answer

A backtest is an argument about the past that you are betting money on, and it lies in eight named ways: look-ahead bias, survivorship bias, multiple testing, cost amnesia, regime myopia, unadjusted data, execution fantasy and the psychology of self-deception. Each has a precise mechanism and a countermeasure. The structural defence is a held-out set and walk-forward validation, and the honest posture is that a backtest can only ever fail to disqualify a strategy. It can never confirm one.

A backtest does not tell you what a strategy will do. It tells you what a strategy would have done, on one historical path, under whatever assumptions you fed it, and the distance between those two statements is where money is lost. The failures below are not exotic. They are the ordinary ways a well-meaning test flatters a weak idea, and most retail backtests carry several at once. This page is the integrity treatise: the running of the test itself, the seven-step protocol, lives in the method guide on backtesting trading strategies in India, and this page does not repeat it. What follows is how to take a curve apart.

1. Look-ahead bias: using tomorrow's information today

Look-ahead bias is the use, at a simulated decision point, of any fact that would not have been knowable at that instant. It is the most seductive failure because the code looks correct and the equity curve looks wonderful, and it is only in live trading, where the future is genuinely unavailable, that the edge evaporates.

The textbook version is the same-bar close. A rule computes a signal from a daily candle's closing price and then enters at that same close, but the close is not known until the session ends, so the position could never have been taken at that price. A subtler version is adjusted data leaking a corporate action: a back-adjusted price series encodes a split or bonus that had not yet been announced at the historical date, so the simulation quietly reads a future event. A third is the repainting indicator, one whose past values change as new data arrives, so the signal you see on the chart today was not the signal that existed then.

What makes look-ahead worth measuring rather than merely naming is that the damage is quantifiable on a single trade. Take a rule that fires on a strong close. The signal bar closes at a price; the next session opens somewhere else, usually in the direction of the signal, because everyone else read the same close. The distance between those two prices is not slippage and it is not bad luck. It is the exact amount the simulation stole from the future, and it is booked on every trade the rule ever takes.

Look-ahead bias measured on a single trade The same fourteen sessions drawn twice. Filling at the signal bar's close books 1,243 rupees; the next session opens at 1,258 rupees. The 15 rupee gap, 1.21 percent of the fill, is pure look-ahead, and it is booked on every trade the rule takes. The cure is to shift the signal forward one bar so the rule can only act on information that already exists. The same signal, two clocks One of these fills was available to you. The other was not. Clock 1: fill at the signal bar's close what the backtest did ₹1,260 ₹1,230 ₹1,200 A close is not knowable until the bar is over. Clock 2: fill at the next bar's open what the market allowed ₹1,260 ₹1,230 ₹1,200 The next open is the first price an order can touch. ₹1,243 ₹1,258 The leak is not an opinion. It is a number, and you book it on every trade. Backtest fill ₹1,243.00 Live fill ₹1,258.00 Leak per share ₹15.00 Leak per trade 1.21% A rule that takes two hundred round trips a year books this leak two hundred times, and it was never yours to book. position = signal.shift(1) The whole cure: hold the signal back one bar, so the rule can trade on it only after it exists. Illustrative. The same fourteen sessions are drawn in both panels; only the fill rule changes. The signal bar closes at ₹1,243 and the next session opens at ₹1,258, so a backtest that fills at the signal close books ₹15 a share that no order could have captured.
The leak is a price, not a feeling. Both panels hold the same fourteen sessions; only the clock changes. The signal bar closes at ₹1,243, so a backtest that fills there books a price that did not exist until the session was already over. The first fill a real order could take is the next open at ₹1,258. That ₹15, about 1.21 percent of the fill, is not slippage and not bad luck: it is information taken from the future, and it is booked on every trade. In a vectorised test the entire cure is holding the signal back one bar.

The cure is embarrassingly small. Every input used at time t must be provably available by t, which in practice means the signal computed on a bar must be held back before any position can act on it. In a vectorised back-test that is one line: position = signal.shift(1). The signal still comes from the close; the position it produces simply cannot exist until the next bar. Most look-ahead in retail code is that one missing shift, and the version without it will always show the better curve, which is precisely why it survives review.

The tell. Look-ahead is invisible in the backtest by definition, because the leak helps the simulation. It surfaces only as unexplained live decay. If your live results are worse than the test and nothing about the market has obviously changed, audit the clock before you audit the market: check that every value the rule reads at time t existed at time t, and that signals computed on a bar's close execute no earlier than the next bar's open.

2. Survivorship bias: testing only on the winners

Survivorship bias is testing a strategy over history using a universe defined by present membership. Today's index lists exclude every constituent that was delisted, merged away or demoted, so a backtest built from them is a backtest run only on the companies that made it to the end. The failures are simply absent from the sample, and their absence makes the past look kinder than it was.

The Indian illustration is exact. Backtest a rule on the current Nifty 500 and you have silently dropped every stock that fell out of the index over your test window. The Nifty 500 is reconstituted semi-annually, with cut-off dates of 31 January and 31 July and changes effective in March and September, and at each review names leave and names enter. A strategy tested only on the residents of the latest list never had to hold the ones that were thrown out, which is precisely the set most likely to have hurt.

The error runs in both directions, and the second direction is the one people miss. Today's list also contains names that joined partway through your window: a company that listed in 2021 and qualified for the index in 2022 is on the list now, and testing it across 2018 to 2020 back-fills a known winner into years it did not occupy. That is not merely survivorship; it is look-ahead wearing a universe as a disguise, because membership today is information from the future. Both errors push the same way, and they compound.

Survivorship: the universe then against the list now Twelve constituents are followed from April 2018. Four leave the index during the window, by delisting, insolvency, merger and demotion, and their bars stop at the exit date. Eight survive to the right edge, and two more join partway through. A backtest built from today's list reads only the right edge, so it sees ten survivors and never the four names that left. Today’s list is only the right edge of the history A twelve name slice of an index, followed forward from April 2018. Every bar is one constituent’s time in the index. THE INDEX AS IT STOOD IN APRIL 2018: 12 NAMES TODAY’S LIST: 10 NAMES Private bank Housing finance lender delisted Mar 2019 after a payment default IT services major Infrastructure developer resolved under insolvency, Sep 2019 Cement producer Regional lender merged into its acquirer, Mar 2020 Auto components maker Diversified financier State owned telecom demoted at the Sep 2021 review Staples manufacturer Speciality chemicals Power utility JOINED AFTER THE WINDOW OPENED Digital payments platform not listed until 2021 Renewables developer too small to qualify until 2022 2018 2019 2020 2021 2022 2023 2024 Illustrative. A backtest that draws its universe from today’s list samples this picture at the gold line only. It tests the ten bars that reach the right edge, never the four that stop short, and it back-fills the two late joiners into years they were not in the index.
The dropped names are the point. Four of the twelve stop short of the right edge, and each carries the reason it left: a default, an insolvency, a merger, a demotion. Those four were tradable at the time and are exactly the outcomes a strategy would have had to survive, yet a backtest that reads the universe at the gold line never sees them. The two late joiners show the mirror error, a rule tested across years its stocks were not in the index. The countermeasure is a point-in-time universe: reconstruct, for each historical date, the membership that was live on that date, and include the names that later left.

The countermeasure has a name and it is not optional: a point-in-time universe. For each historical date in the test, reconstruct the constituent list that was actually live on that date, including the names that later left, and let the rule trade only what it could have traded then. This is real work, because it needs a history of index changes and price series for delisted names that vendors are least likely to keep. That difficulty is the whole reason the bias is so common: the correct universe is expensive and the wrong one ships with the data.

3. Multiple testing: the maximum of noise looks like an edge

Overfitting is tuning a strategy's parameters until the past submits. Every free parameter is a dial, and with enough dials any curve can be bent to fit any history, so a beautifully smooth in-sample equity line can be nothing more than a rule that has memorised noise. The failure is not that the numbers are wrong; it is that they describe the past and not the future.

The deeper trap is multiple testing, and it is worth being precise about it, because it is the one failure people believe they are too careful to commit. Suppose you try one hundred parameter variants and report the best. That best result is not an unbiased estimate of anything: it is the maximum of one hundred draws, and the maximum of many noisy draws is high by construction, whether or not any real edge exists. You did not discover the winner. You selected it, and selection alone manufactures an impressive statistic out of pure chance.

That claim is easy to assert and easy to demonstrate, so the figure below demonstrates it rather than illustrating it. It contains one hundred equity curves generated from a coin flip, a process with a true edge of exactly zero, because zero is what was fed in. Nothing in the picture has an edge. The best of the hundred still finishes well clear of the line.

The maximum of one hundred noisy trials is high by construction One hundred equity curves drawn from a zero drift process, so the true edge of every variant is zero. The best still finishes at plus 12.7 and the worst at minus 11.7, and the distribution of the hundred final scores is centred on roughly zero. Selecting and reporting the maximum therefore produces an impressive number out of pure chance. One hundred variants, zero edge, one winner Every curve below was generated by a coin flip. Nothing in this picture has an edge, because none was put in. The search: 100 parameter variants of one rule, on one data set +10 +5 -5 -10 the true edge of every one of these rules: zero best of the 100: +12.7 worst of the 100: -11.7 Where those 100 final scores actually landed centred on nothing: mean +0.23 the one you would have reported -10 -5 +5 +10 0 Illustrative. One hundred random walks with zero drift, so the honest score of every variant is zero. 54 of the 100 still finished above the line, the best at +12.7 and the worst at -11.7. Report the best and you have reported the right tail of noise.
Selection is the bias. Every curve here comes from a coin flip, so the honest score of all one hundred variants is zero. Fifty-four still finished above the line and the best reached +12.7, not because it found anything but because the maximum of a hundred noisy draws is high by construction. The histogram is the proof: the distribution is centred on nothing, and the winner is simply its right tail. Report that variant and you have reported your own search. The defences are to record every trial you ran, hold out data the search never touches, and, following Bailey and Lopez de Prado, discount the headline result for how wide the search was.

This is the core of a well-established research tradition. David H. Bailey and Marcos Lopez de Prado, with co-authors, formalised it in work on backtest overfitting, the probability of backtest overfitting, and the deflated Sharpe ratio, which adjusts a strategy's headline statistic downward to reflect how many trials were run before the winner was picked. The lesson needs no formula to state: the more variants you test, the higher the score you will find by luck alone, and an honest evaluation has to discount for the breadth of the search.

The number you report is not the number your rule earned. It is the number your search found, and a search that looks at a hundred things will find a hundredth-best thing.

The practical discipline follows directly. Record the number of trials, including the ones you abandoned, because a variant you tried and discarded still counts against you; the count is not how many you kept, it is how many you looked at. Prefer fewer parameters, and prefer parameters with an economic reason to exist over ones that merely improved the fit. And treat the winner of any search as a suspect rather than a discovery, because you have not measured its edge, you have measured the right-hand tail of your own effort. This failure and the last section's cure are the same problem seen twice: information leaking from where it should not, whether from the future or from the search.

4. Cost amnesia: the zero-friction fantasy

A backtest run without costs is a backtest of a market that does not exist. Every real fill pays a stack of frictions, and in India that stack is not trivial: brokerage, the securities transaction tax, exchange transaction charges, the goods and services tax on those charges, stamp duty, the bid-ask spread you cross, and the market impact of your own order pushing the price. A rule that trades often can look excellent gross and be a slow loss net, because each round trip pays the toll and the toll compounds.

Two facts about the Indian stack matter more than the rest, and a worked round trip makes both of them visible. The first is that the securities transaction tax is the heaviest single line by a wide margin: on an equity delivery round trip it is charged at 0.1 percent on the buy and 0.1 percent on the sell, which dwarfs the exchange transaction charge, the SEBI turnover fee and stamp duty combined. The second is that turnover is the multiplier: almost every line is levied as a percentage of value traded, so the toll is not a fixed cost you can amortise, it is a tax on activity that scales one-for-one with how often the rule trades.

Illustrative. The friction stack on one equity delivery round trip of ₹1,00,000 each way, or ₹2,00,000 of turnover, at rates published for the 2026 schedule. Rates change; the shape does not.
LineHow it is chargedOn ₹2,00,000 turnoverScales with
BrokerageNegotiated; frequently zero on delivery at a representative Indian retail broker₹0.00Turnover or a flat fee per order
Securities transaction tax0.1 percent on the buy and 0.1 percent on the sell, for equity delivery₹200.00Turnover, both sides
Exchange transaction chargeAbout 0.00307 percent of turnover in the cash segment₹6.14Turnover
Stamp duty0.015 percent, buy side only, on delivery₹15.00Buy-side turnover
SEBI turnover fee₹10 per crore of turnover₹0.20Turnover
GST18 percent on brokerage plus exchange charges plus the SEBI fee₹1.14The three lines above
Depository chargeA flat rupee amount on a delivery sellflatNothing: the only line that ignores size
The spread you crossRoughly half the bid-ask spread on each side; never itemisednot on any billTurnover and liquidity
Market impactYour own order walking the book; never itemisednot on any billOrder size against depth
Billed totalThe statutory and exchange lines aboveabout ₹222About 0.111 percent of turnover, roughly 90 percent of it STT

Read the table as a rule rather than a number. Rates move with every budget, and the arithmetic above is illustrative, but the shape is stable: one line dominates, that line is charged on turnover, and two of the largest costs never appear on a contract note at all. The two unbilled lines are the ones a backtest is most likely to omit, because there is no invoice to remind you they existed. High-frequency rules are the most exposed, since their edge per trade is smallest relative to a toll that does not shrink. The principle is non-negotiable: model the full cost stack, then model impact on top, before you believe any result. The worked rupee arithmetic for intraday, futures and options belongs to the method guide; what belongs here is the discipline of never reading a gross curve as though it were a net one.

5. Regime myopia: one long bull market is not a sample

A strategy tested across a single market regime has been tested against a single question, and it will answer that question and no other. If your window is one uninterrupted uptrend, a rule that simply stays long will look like genius, and a rule that shorts will look broken, and neither verdict tells you how either behaves when the regime turns. The past is not one environment; it is a sequence of them, trending and ranging, calm and violent, rising and falling.

A strategy that works in one regime is not wrong. It is conditional, and a conditional strategy whose condition you have not named is an unexploded position.

The fix is to span regimes and bucket the results. Deliberately include trending and mean-reverting periods, high and low volatility, drawdowns as well as rallies, and then report performance separately for each bucket rather than as one blended number that hides where the edge came from. Bucketing is what converts a vague result into a usable one: a rule that earns everything in high-volatility trends and gives it back in quiet ranges is not a failure, it is a rule with an operating envelope, and knowing the envelope is the whole point. The companion discipline is to detect the regime you are in and adapt, which is the subject of the guide on regime filters for trading in India.

The sample-size illusion. Regime myopia hides behind large trade counts. Ten thousand trades taken inside one three-year uptrend are not ten thousand independent tests of an idea; they are one long bet on a single regime, sampled ten thousand times. The number that matters is not how many trades you have but how many genuinely different environments they span, and that number is usually small enough to count on one hand.

6. Unadjusted data: the corporate-action cliff

This is the failure most specific to Indian data, and the one worth working through in full. NSE historical price series are not adjusted for corporate actions. When a company issues bonus shares or splits its stock, the number of shares rises and the price per share falls proportionally on the ex-date, with no change to the company's value. The adjustment factor is defined and public: for a bonus of ratio A:B it is (A + B) / B, which for a 1:1 bonus equals 2, and the exchange applies it after the close of the last day the stock trades cum-bonus.

Now read that through the eyes of a naive backtest running on raw, unadjusted prices. A stock near ₹800 goes ex on a 1:1 bonus and opens the next session near ₹400. Nothing bad has happened: every holder now owns twice the shares and is exactly as wealthy as before. But the unadjusted series shows a vertical fall of about 50 percent overnight, a cliff. A trend or breakdown rule reads that cliff as a crash and fires a short. A stop-loss on a long position is blown through for a loss that never occurred. The signal is entirely a phantom, an artefact of unadjusted data, and every trade it produces is fictional. The same cliff appears on any split, scaled by its own factor.

The phantom crash: one bonus, two data sets The unadjusted series falls from about 800 to about 400 on the bonus ex-date, a cliff a naive backtest reads as a crash and a breakdown rule trades as a signal, although the holder's wealth does not change. Back-adjusting the pre-bonus history by the factor of two removes the cliff entirely: on its own scale the same fortnight is an ordinary 24 rupee drift with no event on the ex-date. The same stock, the same fortnight, across a 1:1 bonus One of these series contains a crash. The other contains the same eighteen sessions, adjusted. As the exchange publishes it: unadjusted ₹800 ₹400 ex-date What the ex-date actually did 100 shares at ₹800 = ₹80,000 200 shares at ₹400 = ₹80,000 change in the holder’s wealth: zero a fall of about 50% that never happened a breakdown rule fires a short here Back-adjusted by the factor (A + B) / B = 2, on its own scale same date, nothing happened ₹412 ₹404 ₹396 Illustrative. A 1:1 bonus doubles the share count and halves the quote, so a holder of 100 shares at ₹800 holds 200 at ₹400 and is exactly as wealthy. The upper series is the raw feed; the lower one is the same eighteen sessions with the pre-bonus history divided by the adjustment factor of two. Note the axis: the real range of this fortnight is about ₹24 wide.
The cliff is in the data, not the market. A 1:1 bonus doubles the share count and halves the quote by design, so the holder is exactly as wealthy at ₹400 as at ₹800. The unadjusted feed still falls off a shelf, and a breakdown rule dutifully shorts it. Back-adjust the pre-bonus history by the factor (A + B) / B and the event disappears: on its own scale the same fortnight is an ordinary drift about ₹24 wide. That contrast is the warning. The artefact was roughly seventeen times the stock's real range, so it is not noise a filter can absorb, it is the largest thing in the series.

Notice the second panel's axis, because it carries a lesson the first panel hides. Once the history is back-adjusted, the real range of that fortnight is about twenty-four rupees wide. The cliff was roughly seventeen times the stock's actual two-week range, which is why no volatility filter, no sanity check on daily returns and no outlier rule will save a backtest that has swallowed one: the artefact is not a mild distortion of the signal, it is overwhelmingly the largest thing in the data. A rule tuned on a series containing a few of these has been tuned mostly on events that did not happen.

Beyond bonuses. The same family of data sins includes unadjusted splits, missing or mis-timed dividend adjustments, bad ticks and zero-volume prints treated as real, and survivorship in the price file itself when delisted series are simply dropped. Each one plants a signal that was never tradable. The mechanism of the corporate action itself is set out in the guide on what a bonus issue is; the backtesting fix is a properly back-adjusted series, an ex-date flag on every affected bar, and a rule that every large gap must be explained before it is traded. Clean, adjusted, point-in-time data is not a nicety; it is the precondition for every result downstream.

7. Execution fantasy: fills the market would never give you

A backtest fills orders in an idealised world, and the gap between that world and the order book is a bias all its own. The common fantasies are filling at the exact close or the exact touch of a level, as if your order were always first in the queue; assuming a whole order fills at one price when real depth would give you partial fills at worsening prices; shorting in the cash segment where intraday-only and availability constraints apply; ignoring lot sizes in futures and options, where you cannot trade an arbitrary quantity and rounding to whole lots changes both sizing and cost; and trading through circuit limits, where the simulated price is available but the real one is frozen and no fill exists at any size.

Each fantasy tilts the result the same way, toward fills better than reality, and that one-directional quality is the signature of the whole family. Random error would cancel; these do not. The countermeasure is conservative execution assumptions: fill at the next bar's open rather than the signal bar's close, add slippage that scales with size and thins with liquidity, respect lot sizes and short-selling rules, refuse fills at frozen prices, and never assume you received a price a real queue would have denied you. When in doubt, model the pessimistic fill; a strategy that survives conservative execution has a margin the optimistic version never proved.

The asymmetry is the point. Every one of these failures makes the curve better, never worse. That is not a coincidence, it is a selection effect on your own attention: a bug that hurts the equity curve gets found and fixed within the hour, and a bug that helps it gets called an edge and shipped. When you audit a backtest, audit the flattering assumptions first, because those are the ones nobody was ever motivated to question.

8. The psychology of self-deception

The final failure is not in the data or the code; it is in the researcher. You want the curve to work. You have spent hours on the idea, you are attached to it, and that attachment quietly steers a hundred small choices: which window to test, when to stop tuning, which unflattering result to dismiss as an outlier, which bug to fix only when it hurts the curve and ignore when it helps. None of it is dishonest by intent, and all of it inflates the result. This is why the same person who would never fake a number will, unprompted, run the search until the past looks kind.

Nobody fabricates a backtest. They simply stop looking for problems at the exact moment the curve starts to please them, and call that moment the end of the research.

Two habits of thought do most of the damage, and both have proper names. Selection is reporting the one window, one universe or one variant that worked and quietly retiring the rest, which is multiple testing committed by hand rather than by loop. Snooping is subtler: you have already read the history, you know which years were kind, and a rule invented after seeing the answer is fitted to the answer even when no optimiser ran. Every Indian trader designing a rule today already knows what the last several years did. That knowledge is in the room, and it cannot be unlearned, only controlled for.

The discipline that answers both is pre-registration: write down the complete rule set, the parameters, the universe, the cost model and the test windows before you run the backtest, and treat any change made after seeing results as a new hypothesis that needs its own out-of-sample data. Fixing the rule in advance removes the freedom to fit yourself to the answer, and writing it down removes the freedom to misremember what you predicted. That habit, deciding the method before you see the outcome, is exactly what the method we teach is built around, because integrity is a process you install before the test, not a verdict you reach after it.

The eight failures at a glance

The catalogue compresses into one table: the failure, the mechanism that drives it, the tell that betrays it, and the countermeasure that answers it. Read it as a diagnostic, not a checklist to skim. Note the column of tells: every one of them is something you can look for in a backtest you have been handed, without access to the code.

The eight ways a backtest lies, with mechanism, tell and countermeasure
FailureMechanismThe tellCountermeasure
1. Look-aheadUses information not knowable at the decision time: same-bar close, leaked corporate action, repainting indicatorGreat backtest, unexplained live decayStrict as-of clock; shift the signal one bar before it can trade
2. SurvivorshipToday's constituent list excludes delisted, merged and demoted names, and back-fills later joinersResults kinder than the era feltPoint-in-time universe, including the names that left
3. Multiple testingBest-of-many trials is inflated by construction; the maximum of noise is highSmooth in-sample, ragged out-of-sample; fragile to small changesRecord the trial count; fewer parameters; discount for the search
4. Cost amnesiaZero or understated STT, brokerage, spread and impact, on a rule whose turnover multiplies all of themStrong gross, weak or negative netFull Indian cost stack plus a size-scaled impact estimate
5. Regime myopiaTest window is a single market environment sampled many timesWorks only while the trend persistsSpan regimes; bucket results by regime
6. Unadjusted dataUnadjusted bonus or split reads as a phantom cliff; bad ticks; dropped seriesA signal on an ex-date; an impossible gapBack-adjusted, clean, point-in-time data; flag every ex-date
7. Execution fantasyFills at the touch, no partial fills, ignored lot sizes, shorting rules and circuit freezesFills better than a real queue allowsConservative fills; slippage; lot and short constraints
8. Self-deceptionThe researcher wants the curve to work and steers small choices; selection and snoopingTuning that stops when the curve looks goodPre-register the rule set before testing

The defence: a held-out set and walk-forward

Seven of the eight failures share one root: information reaching the rule that the rule should not have had, whether from the future, from the survivors, from the search or from the researcher's memory. That shared root is why the defence is single. You cannot patch each leak individually and hope you found them all. You need a structure in which some data has demonstrably never touched the fitting process, so that whatever leaked cannot have leaked into it.

That structure has two parts. The first is walk-forward: optimise on one window, score once on the next window the fit never saw, then slide forward and repeat. The track you report is the stitched sequence of unseen windows, and the discipline that makes it honest is that you keep the losing windows. A walk-forward from which bad folds have been quietly dropped is just multiple testing with extra steps. The second is a held-out set: one block of history sealed at the start and not opened until every decision, every parameter and every rule change is final. It is opened once. If you look at it, tune, and look again, it is no longer held out; it has become part of the fit, and you have spent the only unbiased measurement you had.

Walk-forward validation and the sealed hold-out Six folds, each fitted on three years and scored once on the next unseen year, sliding forward one year at a time. Only the unseen scoring windows are stitched into the reported track, losing windows included. A final hold-out year is sealed and opened only once, after every other decision is final. The only cure that is structural Walk forward: fit on what you have, score on what you have not seen, then slide. Seal one window and never look. fit and tune here score here, once, unseen dropped by the roll sealed until the end Fold 1 Fold 2 Fold 3 Fold 4 Fold 5 Fold 6 sealed 2016 2017 2018 2019 2020 2021 2022 2023 2024 2025 What you may claim The rule was not disqualified on six windows it had never seen, under costs, on a point-in-time universe. That is the whole claim. It is not a forecast, and it is not proof that an edge exists. The stitched out-of-sample track a losing window, kept in the record 2019 2020 2021 2022 2023 2024 Illustrative. Each fold tunes on the gold window and is scored once on the green one, which the fit never saw. Only the green segments are stitched into the track on the right, losing windows included. The 2025 block is never opened until every other decision is final, and it can be opened only once.
The only claim you have earned is a negative one. Each fold tunes on the gold window and is scored once on the green one, which the fit never saw, and only those unseen windows are stitched into the reported track, the losing one included. Drop the bad folds and you have merely moved the multiple testing somewhere less visible. The sealed block is opened once, after every decision is final; look at it twice and it is no longer held out, it is part of the fit. What the whole apparatus buys is not proof, but a boundary on how far you can have fooled yourself.

Even this only limits the damage; it does not eliminate it. A walk-forward has its own free choices, the window lengths and the roll frequency, and those can be tuned like anything else. The held-out set is one sample, so passing it is weak evidence rather than proof. What the structure buys is not certainty but a boundary on how much you can have fooled yourself, and that boundary is the most any test on historical data can give you.

The integrity pre-flight checklist

This is the page's artefact: a numbered list to run against any backtest, yours or one presented to you, before you let its result influence a single decision. If a line cannot be answered yes, the number the backtest produced is not yet evidence.

A pre-flight integrity checklist for any backtest
#CheckWhat it defends against
1Every input at time t existed by time t; the signal is shifted forward before any position can act on it.Look-ahead
2The universe is point-in-time, rebuilt at each date, including names later delisted or demoted and excluding names not yet added.Survivorship
3The rule set, parameters and windows were fixed and written down before the test was run.Self-deception
4The number of parameter variants tried is recorded, including the abandoned ones, and the headline result is discounted for the search.Multiple testing
5Results are validated out-of-sample, ideally walk-forward, on data the fit never saw, with losing windows kept in the record.Overfitting
6The full Indian cost stack, STT included, and a size-scaled impact estimate are applied to every trade.Cost amnesia
7The window spans more than one regime, and performance is bucketed by regime rather than blended.Regime myopia
8Prices are back-adjusted for every bonus, split and dividend; ex-dates are flagged and every large gap is explained.Unadjusted data
9Fills are conservative: next-open, slippage added, lot sizes, short-selling rules and circuit freezes respected.Execution fantasy
10A held-out block was sealed before the work began and has been opened at most once.All of the above
Read the checklist as a gate, not a garnish. A backtest that clears all ten is a hypothesis worth taking to paper trading. A backtest that fails even one has produced a number that looks like evidence and is not. The failures on this page are additive: two together do not average out, they compound, and the typical impressive retail curve carries several at once.

What a backtest can and cannot say

Run the whole catalogue and a sober picture emerges, and it is narrower than most people want. A backtest is not a promise and not a proof; it is a single controlled experiment on one historical path, and its worth is exactly the discipline with which it was run. The value is not in the equity curve, which any of the eight failures can inflate at will. The value is in the honesty of the assumptions behind it: the point-in-time universe, the realistic costs, the out-of-sample validation, the regimes spanned, the rule fixed in advance.

Which leads to the one sentence worth carrying away. A backtest can only ever fail to disqualify a strategy. It cannot confirm one. Every failure on this page is a way of manufacturing a pass, and not one of them is a way of manufacturing a fail, so a good result is weak evidence and a bad result is strong evidence. That asymmetry is not pessimism, it is the correct reading of what the instrument does: you are asking whether the past is consistent with an idea, and consistency is a much smaller claim than truth. A rule that survives all eight failures, walk-forward and a sealed hold-out has earned exactly one thing, the right to be tried small with real money, where the future is finally unavailable and the test becomes honest whether you like it or not.

Integrity is upstream of the result. It is installed before the test, in the choices you make about data, universe, costs and the pre-registered rule. It is never recovered afterwards by admiring the curve.

The order of operations is the whole craft. Decide the method, then run the test, then believe only what the method allows. Reverse any two of those steps and the eight failures on this page stop being hazards you are guarding against and start being tools you are unconsciously using. The curve will look better either way. That is the problem.

Common Questions

Frequently Asked Questions

Look-ahead bias is using information at a simulated decision point that would not have been available at that moment. The classic version enters on a signal computed from the same bar's close, when in reality you could not have known the close until the bar ended. It also creeps in through corporate-action-adjusted data that encodes a future event, and through indicators that repaint after the fact. The tell is that live results fall short of the backtest for no visible reason. The fix is a strict as-of clock: every value used at time t must have existed by t, which in code is usually one line, shifting the signal forward a bar before the position can act on it.

Survivorship bias is testing a strategy on a universe defined by today's membership, which silently excludes every name that was delisted, merged out or demoted. Backtesting on the current Nifty 500 drops every stock that fell out of it over the test window, so the sample is built only from survivors. Because the losers are missing, results look better than the past actually was. The same error runs the other way too: today's list contains names that were added partway through, and testing them across years they were not in the index back-fills winners into a past they never occupied. The countermeasure is a point-in-time universe: at each historical date, use the constituent list that was live on that date, delisted names included.

Overfitting shows up as a large gap between how a strategy scored on the data it was tuned on and how it scores on data it never saw. If you tested many parameter variants and reported the best one, its statistics are inflated by construction, because you selected the luckiest draw from a set of trials. Simulate one hundred variants of a rule with no edge at all and the best of them will still look impressive, purely because the maximum of many noisy draws is high whether or not any edge exists. Warning signs are many tuned parameters, a curve that is smooth in-sample but ragged out-of-sample, and fragility to small parameter changes. The discipline is to hold out data, record and limit the number of trials, and treat the best-of-many result with suspicion.

The most common causes are that the backtest was optimistic in a way live trading is not. Costs and slippage were understated or absent, the test window was one regime that has since ended, the rule was tuned to noise so it never had a real edge, or a subtle look-ahead let the simulation peek at information you cannot get live. Decay is the expected result of any of these. The honest response is to audit the backtest against each named failure rather than assume the market changed.

The sharpest one is corporate actions. NSE historical price series are not adjusted for bonuses and splits, so an unadjusted 1:1 bonus or a stock split appears as a phantom fall of about half on the ex-date, a cliff a naive backtest reads as a crash and a momentum rule reads as a signal. The adjustment factor for a bonus of A:B is (A+B)/B, which is 2 for a 1:1. The second is the cost stack: the securities transaction tax is the heaviest single line on an Indian equity round trip, and it is charged on turnover, so it scales with how often the rule trades. Other India-specific issues are circuit-limit freezes that make prices unfillable and lot-size rounding in derivatives. The fix is a properly back-adjusted series and a full cost model.

There is no fixed number, but the risk rises fast with every free parameter, because each one is another dial you can turn to fit the past. A useful frame is degrees of freedom against sample size: a handful of parameters fitted on thousands of independent observations is defensible, while many parameters fitted on a few hundred trades will fit noise. The multiple-testing research tradition of Bailey and Lopez de Prado formalises this: the more variants you try, the higher the score you will find by luck alone, and the deflated Sharpe ratio adjusts the headline statistic downward to reflect how wide the search was. Prefer fewer parameters with an economic reason.

Walk-forward analysis is the structural cure for tuning to the past: you optimise on one window, test on the next unseen window, then slide forward and repeat, so every result you keep comes from data the rule never saw during fitting. It turns a single in-sample fit into a sequence of honest out-of-sample tests, and the track you report is the stitched sequence of those unseen windows, losing ones included. The full seven-step protocol for running one is set out in our method guide on backtesting trading strategies in India.

No backtest is proof; the honest answer is a matter of degree. A backtest is a hypothesis test on one historical path, not a forecast, and every failure on this page erodes how much weight it can bear. The strongest thing a clean backtest can ever say is negative: this rule was not disqualified on data it had never seen, under costs, on a point-in-time universe. A test that uses those disciplines deserves more trust than one that skips them, but even the best deserves humility. Treat a backtest as evidence to be challenged, not a promise to be believed.

Where the facts come from

Sources

  • Backtest overfitting and the deflated Sharpe ratio. David H. Bailey and Marcos Lopez de Prado, The Deflated Sharpe Ratio, Journal of Portfolio Management 40(5), 2014, which corrects a strategy's Sharpe ratio for selection bias under multiple testing. Establishes that picking the best of many trials inflates the statistic by construction. papers.ssrn.com
  • The probability of backtest overfitting. David H. Bailey, Jonathan M. Borwein, Marcos Lopez de Prado and Qiji J. Zhu, The Probability of Backtest Overfitting, Journal of Computational Finance 20(4), 2017. Establishes the formal link between the number of configurations searched and the likelihood the winner is a false positive. davidhbailey.com
  • Corporate action adjustment and unadjusted NSE data. NSE Clearing, Corporate Actions Adjustment: the adjustment factor for a bonus issue A:B is (A+B)/B, applied after the last cum-basis trading day, and NSE historical price series are not adjusted for corporate actions. Establishes the phantom-cliff mechanism on the ex-date. nseclearing.in
  • Index reconstitution and survivorship. NSE Indices, Methodology Document for Equity Indices: the Nifty 500 is reconstituted semi-annually with 31 January and 31 July cut-off dates, effective in March and September. Establishes that today's list is not the historical universe. nseindia.com
  • The Indian cost stack and why STT dominates it. NSE first-time-investor reference on SEBI turnover fees, the securities transaction tax and other levies, together with the exchange transaction charge circulars: equity delivery STT 0.1 percent on both the buy and the sell, equity intraday 0.025 percent on the sell only, cash-segment exchange transaction charge about 0.00307 percent, SEBI turnover fee ₹10 per crore, stamp duty on the buy side, and GST 18 percent on brokerage plus exchange charges plus the SEBI fee. Establishes that STT is the heaviest single line and that every material line is levied on turnover. nseindia.com
Educational note. This guide explains how backtests deceive and how to test their integrity. It is not a recommendation to trade or invest, and it is not investment advice. Rupee, rate and price figures on this page are illustrative and were correct to the published schedules cited above at the time of writing; statutory rates change. Bharath Shiksha is an educational publisher, not a SEBI-registered investment adviser or research analyst.

Related guides

Backtesting trading strategies in India

Read →

Regime filters for trading in India

Read →

How to build a trading system in India

Read →

A curve can lie eight ways. Learn to test it honestly.