← Backtesting guide

Overfitting in Algorithmic Trading

Overfitting occurs when a strategy is tuned so precisely to historical data that it captures noise rather than signal. The result: a spectacular backtest and a failing live strategy. Overfitting is the single most common reason backtests fail to generalise.

How does overfitting happen?

Every time you adjust a parameter, add a filter, or pick a threshold based on in-sample results, you are implicitly fitting to historical noise. With enough degrees of freedom, any random walk can be made to look profitable in hindsight.

How do you detect overfit strategies?

The key test: run your strategy on out-of-sample data it has never touched. A large performance gap between in-sample and out-of-sample periods is the clearest sign of overfitting. The Deflated Sharpe Ratio provides a statistical correction for multiple testing bias.

Next: Look-ahead bias →

See: Deflated Sharpe Ratio →

© 2026 backtester.run · All rights reserved · support@backtester.run

Backtest results are hypothetical and do not guarantee future performance.