Free tool · No signup · Signature demo

The Overfitting Demo

Backtests are not useless, bad backtesting is. Turn up the optimization and watch the in-sample curve become gorgeous while the same strategy dies on data it has never seen. This is how a 'perfect' backtest lies.

Overfitting is when a strategy is tuned so tightly to past data that it starts fitting random noise instead of a real pattern. It looks flawless on the history it was built on, then falls apart on data it has never seen.

How it works

Drag the optimization slider up and hit Run. The green line is the strategy scored on the data it was tuned on, the red line is the exact same strategy on fresh data it never saw. The harder you optimize, the wider the two split apart.

Tune the strategy

Optimization / curve-fitting
True underlying edge
Trades
Same strategy, two datasetsin-sampleout-of-sample
+92%
in-sample return (the lie)
-81%
out-of-sample return (the truth)
+174%
overfit gap

Why the green line is a trap

When you optimize a strategy hard enough, you stop finding real patterns and start fitting the random noise of your test period. The in-sample curve (green) looks incredible because it was literally tuned to that exact data. The out-of-sample curve (red) is the same strategy on fresh data it was never optimized on, and it collapses, because the noise it memorized never repeats.

The fix isn't to avoid backtesting, it's to always hold back data the strategy never sees during building, and to judge it only on that. That out-of-sample result is the only number that predicts the future.

Frequently asked

What causes overfitting?

Testing too many variations and keeping only the one that looked best on your history. The more knobs you turn, the more you fit noise instead of signal.

How do I avoid it?

Hold back a chunk of data the strategy never sees while building, and judge it only on that out-of-sample result. Keep the number of parameters small.

Build with a proper in-sample / out-of-sample split baked in, so you find real edges, not fitted noise. No code.

Join the waitlist
Algovex, build and backtest your strategy