Skip to content
Menu

Overfitting

By Chad Smith, Director of Research & Analysis · Updated

On this page
  1. Worked example
  2. Why it matters to a trader
  3. Common confusions
  4. Related terms

Overfitting, also called curve fitting, is tuning a trading strategy so closely to past data that it captures random noise rather than a real, repeatable pattern, so it performs well in a backtest and poorly on new data.

Worked example

Example: a trader tests a moving-average strategy on two years of data.

  • Version 1: a single rule with one setting. Backtest result: modest profit with uneven swings.
  • Version 2: the trader adds filters. Only trade on Tuesdays and Thursdays, skip March, use a 37-period average, a 23-pip stop and a 61-pip target. Backtest result: smooth, steady profit.

Version 2 looks far better, but every extra rule was chosen because it improved past results, not because there is a reason for it. On the next six months of unseen data, Version 2 loses money while Version 1 stays roughly in line with its backtest. These results are illustrative.

Why it matters to a trader

Overfitting is one of the most common reasons strategies that look good on paper fail in live trading. The more settings you tune, the easier it is to find a combination that fits the past by chance.

Ways to reduce it:

  • Keep it simple. Fewer rules, each with a clear reason.
  • Hold back data. Build on one period, then test on another the strategy has never seen.
  • Check stability. Results should be similar if a setting changes slightly.
  • Forward test. Real-time results are the final check.

Common confusions

  • Good backtest equals good strategy. A very smooth equity curve is often a warning sign, not proof.
  • Optimization versus overfitting. Choosing reasonable settings is fine. Searching thousands of combinations for the best past result is where the risk lies.

Where to practice this

Put this into practice on a demo account first, with no money at risk.

Frequently asked questions

What are signs of an overfitted strategy?

Very smooth backtest results, many rules or settings, results that collapse when a setting changes slightly, and poor performance on new data.

How can I avoid overfitting?

Keep rules simple, test on data the strategy was not built on, use forward testing, and check that results are stable across nearby settings.

Is optimization always overfitting?

No. Testing a few sensible settings is normal. Overfitting happens when you keep tuning until the past looks perfect.

Are commercial expert advisors often overfitted?

Some are marketed with very smooth backtests. A long, independently verified live record is a better guide than a backtest alone.