A perfect fit to the past is a warning sign
Imagine fitting a curve through ten points. With enough knobs you can draw a line that touches every point exactly. It describes the past perfectly, and it says nothing useful about the next point, because it has memorised the noise. A strategy tuned the same way does the same thing.
Optimisation tools make this easy. If you test thousands of combinations of settings on the same history, some of them will look excellent by pure chance. The more combinations you try, the better the best one looks, and the less it means.
How it happens
- Too many parameters: each adjustable setting is another knob for fitting noise.
- Too little data: a short history has few independent events, so chance dominates.
- Testing and tuning on the same period: the result is measured on the data it was shaped by.
- Choosing the best of many runs and reporting only that one.
| Sign of a robust strategy | Sign of an over-fitted one |
|---|---|
| Few settings, each with a clear reason | Many settings with odd-looking values |
| Works across a wide range of settings | Only one narrow combination works |
| Similar results on data it never saw | Great on the test period, weak outside it |
| Works on related markets or periods | Falls apart when the start date moves |
How to test against it
- Hold back data. Tune on one period, then test once on a later period the strategy has never seen (out-of-sample).
- Walk forward. Tune on a window, test on the next, then slide both forward and repeat.
- Nudge the settings. Move each by a little. If results collapse, the strategy is brittle.
- Test costs and spread higher than you expect.
- Run it forward on a demo account and compare with the backtest.
Frequently asked questions
How can I tell if a robot is over-fitted?
Ask how many settings were optimised, whether results hold on data after the tuning period, and whether live trading matches the backtest. A fragile result is a red flag.
Is optimisation always bad?
No. Optimising a few settings on enough data, then validating on unseen data, is sound. The problem is tuning many settings and trusting one run.
What is out-of-sample testing?
Testing on data that was not used to choose the settings. It is the closest a backtest gets to a real experiment.
Sources and method
- Standard risk-management and statistics formulas. Every example in this lesson uses made-up round numbers to show how the maths works; none of them is a result or a forecast.