Every Quant

Overfitting

Short answer

Overfitting is when a trading strategy is tuned so closely to past data that it captures random noise rather than a lasting market behaviour. An overfitted strategy looks strong in the backtest and then disappoints on new data.

Every set of historical prices contains a real structure and a large amount of noise. A flexible enough model can fit both. The more rules, settings and variants a designer tries, the easier it becomes to find a version that fits the noise perfectly. That version has learned the accidents of a particular history, and those accidents will not repeat.

How it is used in strategy design and testing

Overfitting is the central risk in strategy design. Designers fight it in several general ways. They start from an economic reason for the idea, so the rules follow a hypothesis instead of a search. They keep the number of free choices small. They prefer settings that sit in a broad stable region, where nearby choices give similar results, over a sharp peak where small changes break the result.

In testing, the main defence is out-of-sample data: build the idea on part of the history and judge it on a part it has never seen. Walk-forward testing repeats this through time. Researchers also count how many variants were tried, because the strongest of many trials is expected to look good by luck alone, and some statistical methods adjust the judgement for that count.

Common mistakes

  • Tuning until it looks good. Each extra adjustment after seeing the result spends some of the test's honesty.
  • Reusing the hold-out data. Once the out-of-sample period has shaped a decision, it is no longer out of sample.
  • Forgetting the variants that failed. A result means little without knowing how many alternatives were tried.
  • Complex rules with little data. Many conditions on a short history make a fit to noise very likely.

Where the term comes from

Bailey, Borwein, López de Prado and Zhu showed how testing many strategy variants on the same history makes overfitted backtests likely, and proposed ways to measure that risk.

Education only. Not investment advice.

Questions people ask

What is overfitting in a backtest?

Overfitting in a backtest means the rules were shaped to match the past so closely that they mostly describe noise. The backtest looks strong, but the pattern does not carry over to new data.

How can you tell if a strategy is overfitted?

Warning signs include many rules, sharply tuned settings, a large number of tried variants and a big gap between in-sample and out-of-sample behaviour. A result that falls apart when a setting moves slightly is a common clue.

Is overfitting the same as data snooping?

They are closely related. Data snooping is the process of searching the same data many times, and overfitting is the usual outcome: a model that fits that particular sample too well.

How do traders reduce overfitting?

They start from an economic reason, keep rules simple, test on data they did not use to build the idea, and account for how many variants they tried.

Papers

Written and checked by the Every Quant research team · Updated . How we write and check entries: methods.