How do I test a backtest for overfitting?

Asked as: how to test a backtest for overfitting

You cannot test the backtest. Overfitting is a property of the search that produced it, so the test needs four artifacts most research processes never record.

The short answer

You cannot test a backtest for overfitting. The backtest is the output; overfitting happened upstream, in the search that selected it, and the equity curve carries almost no information about how many alternatives were discarded to produce it. A curve that resulted from one honest hypothesis and a curve that won a ten-thousand-way parameter sweep can be pixel-identical.

So the real procedure is: reconstruct the search, then apply the statistics to the search. That requires four artifacts — the trial count, the performance history of every configuration tried, the data vintage each trial saw, and the order in which decisions were made. Together I call this bundle the Search Receipt. Without it, the overfitting statistics below cannot be computed honestly, and every one of them will report reassurance instead of a result.

WHAT THIS IS — AND WHAT IS NOT PUBLISHED. This article is method. No strategy audit has been run and published here, no figures appear on this page, and none should be inferred. The estimators named below are published statistics from the quantitative-finance literature, cited here as method rather than as my results; where I describe how my own instrument will apply them, that instrument is pre-launch and its outputs are NOT YET PUBLISHED.

The Observable Mechanism

The mechanism has nothing to do with markets. Take a set of configurations with no genuine relationship to future returns, evaluate all of them on the same finite history, and keep the best. Under the null hypothesis of zero skill, the expected performance of that maximum is not zero — it rises with the number of trials, because you selected on the noise. The backtest of the winner therefore looks good by construction. This is why the trial count is not context for the result; it is an input to it.

The four artifacts

1. The trial count, honestly

The most consequential number in backtest evaluation is the one almost nobody records: how many things were tried. Every correction — the probability of backtest overfitting, the deflated Sharpe ratio — conditions on it, and every one of them degrades into false comfort when it is understated.

It is always understated, because memory is the default ledger and memory deletes failures preferentially. Count all of these as trials: parameter sweeps run and abandoned, notebooks deleted because they “didn’t work”, variants a colleague ran on the same data, the thirty-second sanity check that was statistically a full trial, and every re-run after a look at out-of-sample results. The corrective is a kill ledger: append-only, written at the moment of death, complete. The undercount is also a survivorship problem — the discarded variants are the search’s own dead, and does my backtest have survivorship bias is the audit of that door and the two others.

2. The full performance matrix

Not the winner’s equity curve — the performance history of every configuration, over the same time blocks. This is a hard requirement rather than a nicety, because the strongest estimator available to you consumes exactly this object and cannot be run without it.

3. The data vintage each trial saw

What the dataset looked like at the time of the trial, which is a different thing from what it looks like now. Restatements, late corrections, delistings and index reconstitutions all move history under your feet. If your trials ran against a dataset that had been revised since the dates being simulated, you have a look-ahead bias problem sitting underneath your overfitting problem, and correcting the second will not touch the first. Point-in-time data is the property that makes vintage recoverable.

4. The decision order

Which choice was made before which. The universe, the bar size, the cost model, the stop rule, the position sizer and the entry logic were not decided simultaneously; they were decided in a sequence, and choices made after seeing results are a different statistical object from choices made before. Pre-registration exists to make this order recoverable rather than reconstructed.

The tests, once you have the receipt

Probability of backtest overfitting

The most direct instrument. Partition the performance matrix into an even number of time blocks. For every way of designating half the blocks as in-sample, find the configuration that ranked best on that half, then look up where that same configuration ranked on the complementary half. Repeat across all the combinations. The fraction of cases in which the in-sample winner landed below the median out-of-sample is the PBO.

Read it as a statement about your process, not your strategy. A high value says the ranking of configurations is unstable across subsamples — shuffle the data and a different lottery winner emerges. A low value says the selection is finding something that persists across the partitions you tested.

Deflated Sharpe ratio

Take the winner’s observed Sharpe and ask whether it exceeds what the best of N skill-less trials would be expected to produce, additionally correcting for track-record length and for the skewness and excess kurtosis of the return series — both of which make naive Sharpe inference optimistic and both of which are endemic in strategies with asymmetric payoffs. The DSR returns a probability that the true Sharpe exceeds zero, which is a far more sober object than a ratio to be admired.

The method was set out by Bailey and López de Prado; the PBO estimator by Bailey, Borwein, López de Prado and Zhu. Both are conditioned on N. Understate N and the deflation is too gentle, which launders luck into apparent significance.

Walk-forward degradation, published as a curve

Fit on one window, evaluate on the next unseen one, roll forward. Then publish the whole sequence of out-of-sample verdicts rather than the best window. Walk-forward validation is consumable — the first pass is a real test and every later pass leaks — so the honest report is the degradation curve plus a statement of how many passes have been run against this data in total.

The synthetic control

Run the identical search pipeline against data with no exploitable structure, and record what “performance” it manufactures. Whatever the pipeline produces there is your floor: results at or below it are indistinguishable from the search itself. This is the cheapest test on the list and the one most often skipped, because it produces a number that makes the real result smaller.

What the wrong answers get wrong

“Just use more out-of-sample data.” More data lowers variance; it does nothing about selection. A search over enough configurations will find a winner on any sample size, and the winner will be exhibited with its impressive out-of-sample stretch attached.

“Cross-validate it.” Standard k-fold cross-validation assumes independent, identically distributed observations that can be shuffled. Financial time series are neither, and shuffling leaks the future into the training folds. Blocked and purged schemes exist for exactly this reason; using the default from a general-purpose machine-learning library is a leak with a respectable name.

“Simplify the strategy until it has few parameters.” Parameter count is a poor proxy for search intensity. A two-parameter strategy chosen from among four hundred two-parameter candidates has been searched four hundred times. The multiplicity lives in the selection, not in the surviving model’s shape.

“Test it live for a month.” A month of live results is a sample so small that it will be dominated by the market’s regime, and the trader who ran it will almost always continue on the basis of a result that has no power in either direction. It is a real test; it is just not a decisive one, and treating it as decisive is how a genuinely overfit strategy earns another six months of capital.

What This Does Not Establish (The Limits)

Every estimator on this page tests a search, not a market.

A low PBO does not establish that a strategy will make money; it establishes that the configuration ranking was stable across the partitions you happened to test, on the data you happened to have, conditional on a trial count you supplied. All of them inherit the honesty of that count — none can detect trials you did not record, and none has any way to know that you deleted the failures. They do not detect look-ahead bias, survivorship bias, an unrealistic fill model, or a strategy whose capacity is smaller than the size you intend to trade; those are separate failures with separate tests. A backtest that clears every statistic here can still fail in live trading for reasons that have nothing to do with overfitting, which is a different question I treat separately in why backtests fail in live trading. And none of this makes a strategy safe: these are tests of evidence quality, not forecasts, and nothing on this page should be read as a statement about future results.

Where the measured version publishes

The uncomfortable part of this method is that the hardest artifact is not statistical. It is the trial count, and it is hard because keeping one is a record of your own failures maintained against your own incentive to forget them.

That is the part I am building into instrumentation rather than resolutions: the Overfit Auditor is intended to make trial accounting unavoidable and to compute PBO, deflated statistics and walk-forward degradation from the receipt rather than from the winner’s curve, while the Epistemic Harness is intended to make the ledger itself a service. Both are pre-launch. Each now publishes a reading from my own research book rather than a customer’s; neither has published a customer output, and this page carries no figures of its own.

If you want the auditor rather than the spreadsheet: read what the Overfit Auditor measures, and the block stating what it does not establish. It is pre-launch and nothing is for sale.

Claims examined

Claim 01§ claim-bc99e661

A long out-of-sample period proves the strategy is not overfit.

My reading: Misleading

A long out-of-sample period proves it on the first pass and only the first pass. Every subsequent run, after the researcher has seen the out-of-sample result and adjusted anything, converts that period into in-sample data. A strategy on its fifth out-of-sample test has not passed five tests; it has been fitted to one long dataset in an expensive way, and the period's length now overstates rather than understates the problem.

Claim 02§ claim-8b418248

The equity curve looks smooth and realistic, so the backtest is trustworthy.

My reading: False

Smoothness is a property the selection process was implicitly optimising for. Among a large enough set of trials, some configuration produces a plausible-looking curve by chance alone, and it is precisely that configuration which gets kept and shown. Judging a backtest by the appearance of its curve inspects the output of the filter using the filter's own criterion.

Each claim above has a permanent address — the § link — whose canonical home is the refutation index, where it carries its variant phrasings and the true proposition stated on its own feet; this article is the evidence behind it. If a claim's text ever changes, it becomes a new claim at a new address, and the old one stops resolving rather than silently meaning something else.

Cite This Article

Hadal Research. (2026). How do I test a backtest for overfitting?. Hadal Research. https://hadalinstruments.com/research/how-to-test-a-backtest-for-overfitting/ Version 861aa78, 2026-09-14.

Version 861aa78 identifies the commit that last changed this page in Hadal's content repository. That repository is not public, so the identifier does not resolve externally — it is published so a citation pins one specific state rather than a moving page. To obtain the exact version cited, use the press and research route.

---