OpenAITradeETF STRATEGY RESEARCH

OPENAITRADE / TECHNICAL SHARING

How to recognize backtest overfitting

By OpenAITrade editorial · Updated

The winning backtest is also a selected result

Backtest overfitting occurs when a research process selects rules that match historical noise rather than a relationship that persists outside the selection sample. The process includes choices made by the researcher: indicators, parameter grids, instruments, date windows, cost assumptions and decisions to discard runs. Testing more alternatives can make an impressive historical winner easier to find even when the underlying ideas are weak.

The paper The Probability of Backtest Overfitting by Bailey, Borwein, López de Prado and Zhu studies the statistical problem of selecting strategies from investment simulations and proposes a framework for estimating overfitting risk. A website's ordinary backtest completion status is not that statistical test, and we do not claim to have computed the paper's probability measure for the source directory.

Keep a trial log, including discarded variants

Assign an experiment identifier before running a variant. Record the rationale, program and data versions, parameters, selection metric and outcome. Include failures and no-trade runs. If only the final winner survives, a later reviewer cannot distinguish a simple hypothesis from the last survivor of extensive search.

Separate implementation repair from economic optimization. Fixing an indicator calculation to match a written rule is a correctness change; changing its lookback after seeing a disappointing curve is a new research choice. Both need versioning, but they answer different questions. A source-runtime equivalence test also differs from a profitability test.

Reserve data before selecting a model

A chronological holdout is data excluded from model development and selection. Freeze the candidate and evaluation rules before inspecting its holdout result. If a disappointing holdout leads to further tuning, that period has influenced development; calling it untouched again does not restore independence. Keep that history in the research record.

OpenAITrade's current local standardized protocol reserves its final 140 common ETF sessions outside the source execution runtime. It has not scored that reserve as a passed validation test. Reserving data alone also does not prove that source code avoids future-looking behavior within the research segment.

Use complementary checks and describe their limits

A predefined walk-forward experiment can repeat development and evaluation in chronological folds. Parameter-neighborhood checks can reveal whether a conclusion depends on one narrow setting. Cost stress can expose dependence on cheap execution. Each addresses a different failure mode; none makes the future identical to the tested period.

Report how many alternatives were tried, the selection rule, fold boundaries, costs and the checks actually completed. Distinguish a reserved segment, a measured out-of-sample result and a live record. Virtual paper operation can test scheduling and state handling, but it does not establish real fill prices, liquidity or investment suitability.

For technical sharing, quantitative-method discussion and software testing only. Historical simulations and paper operation are not live investment records. Read the full disclaimer.