Trading guides

Trading Debates from Reddit

How to Spot Overfitting in a Trading Backtest

By Trading Statement

On this page

Backtest overfitting occurs when rules capture quirks of the data used to choose them. The more variants tested, the easier it is to find a persuasive historical result by chance.

A time-ordered workflow for an out-of-sample test
  1. Develop rules on older data
  2. Compare variants on validation data
  3. Freeze rules and costs
  4. Evaluate once on later unseen data

The winning settings can hide the search

The Reddit author shares an approach after finding backtesting unreliable. If 200 parameter combinations are tried and only the winner is reported, the report omits evidence of selection. Record all variants, including those that failed, and inspect whether nearby settings give similar outcomes.

Protect the final period

Suppose a moving-average rule uses 2020–2022 for development and 2023 for validation. Reserve a later period and do not tune against it. Each retune inspired by the later result turns that period into development data.

Match data availability to the trading decision. A signal based on a closing price needs an executable timing assumption. Inspect the result by market regime and check whether removing the best trade changes the conclusion.

Sources