Robustness

Overfitting: when the backtest lies

7 min read · by the GetBacktest team

Overfitting (or over-optimization) is the most seductive lie in backtesting: by piling on rules and tuning parameters, you end up with an almost-perfect equity curve… on the past. The problem is that this perfection describes noise, not a mechanism — and noise doesn't repeat.

What overfitting is

To overfit is to shape a strategy so tightly to a specific history that it captures its accidents rather than its logic. Every finely tuned parameter, every filter added “because it improves the curve”, moves you closer to overfitting.

An analogy: memorizing the answers to a past exam earns 20/20 on that exact exam, but 0 the moment the questions change. A future market always asks new questions.

The warning signs

Too many parameters, an abnormally smooth equity curve, very specific rules (“only enter on Tuesdays between 10 and 11 a.m.”), performance that hinges on a handful of trades, or that collapses at the slightest change of setting.

Another signal: the more variants you tested to find “the good one”, the higher the odds of a false positive. Searching long enough always ends up surfacing a combination that shines by chance.

Why it doesn't survive

A real edge rests on a recurring market imbalance. An overfitting artifact rests on past coincidences, which have no reason to recur.

Live, the overfitted strategy does the exact opposite of its promise: it underperforms, often within the first weeks, leaving the trader baffled by the gap with their “perfect backtest”.

How to guard against it

Favor simplicity (few parameters, an explainable logic), always validate out-of-sample (walk-forward), and beware any rule added solely to prettify the curve.

Finally, correct for the number of trials: the deflated Sharpe (DSR) penalizes exactly the fact of having tested many variants. Together, OOS + DSR + Monte-Carlo form the best defense against self-delusion.

Don't believe it — prove it

Backtest this concept on real data, tick by tick, and get a robustness verdict. 7 days of Pro free, no card.

Start for free

Frequently asked questions

What is overfitting?

Over-optimization: tuning a strategy so tightly to the past that it fails on new data.

How do I detect overfitting?

Compare in-sample and out-of-sample (walk-forward): a large gap betrays overfitting. Also beware overly smooth curves and strategies with many parameters.

How many parameters is too many?

There's no magic threshold, but each extra parameter raises the risk. A rule: if you can't explain WHY a parameter makes market sense, remove it.

Read next

Overfitting in trading: recognizing and avoiding it | GetBacktest