Overfitting happens when a strategy is tuned so closely to past data that it describes the noise in that data rather than anything repeatable. The result is a backtest that looks excellent and live trading that does not. This guide explains how it happens, how to spot it, and what to do instead.
TL;DR -- Key Takeaways
- An overfitted strategy memorises the past; it does not describe a pattern that should continue.
- Every extra rule, filter or tuned number gives the strategy more room to fit noise.
- Warning signs include a very high win rate, many parameters and results that collapse when settings change slightly.
- Out-of-sample testing, simple rules and a demo period are the main defences.
- Treat any "perfect" backtest as a reason to look harder, not a reason to start trading.
1. What Overfitting Looks Like
Imagine you test an indicator combination on three months of charts and keep adjusting it until the win rate rises. Change the period from 14 to 11. Add a filter that removes a bad week. Exclude one pair that did badly. Each change makes the past look better. None of them has to reflect how markets work. By the end, the rules are a description of those three months, not a method.
When the strategy meets new data, the quirks it was fitted to are gone and the performance falls back toward what the underlying idea can really deliver, which may be nothing.
2. Warning Signs
Many parameters. Several tuned periods, thresholds and time filters mean many chances to fit noise. A rule set you cannot explain in a few sentences deserves suspicion.
Fragile settings. If moving a setting slightly, such as an RSI period from 14 to 13, changes results sharply, the edge was probably in the tuning, not in the idea.
Exclusions with no reason. Dropping assets, days or hours only because they lost money is fitting, not analysis. A valid filter has a reason that exists before you see the numbers.
Results that look too good. Very high win rates over small samples are a standard outcome of overfitting. See win rate mathematics and strategy realities.
One market condition only. A strategy tested only in a calm trend may fail when conditions change. See market regimes and volatility strategies.
3. How to Reduce the Risk
- Write the idea first. State why the pattern should exist before you test it. "Price tends to react at prior swing levels" is an idea; "RSI 11 with a 7 pm filter" is a result.
- Keep rules few and fixed. Decide the number of rules and tunable settings in advance.
- Split the data. Build the rules on one period (in-sample). Then test unchanged on a later period you have not looked at (out-of-sample). If the results collapse, the first period was fitted.
- Test neighbouring settings. A sound idea should work across a range of nearby settings, not at one exact value.
- Test on other assets and periods. Honest results will be weaker but similar. Wildly different results are a warning.
- Move to a demo account and record trades before risking money. See backtesting your own strategy.
4. A Simple Self-Check
Before trading a strategy live, answer these in writing.
- Why should this edge exist?
- How many settings did I tune, and how many did I test?
- How did it perform on data I did not use to build it?
- What happens to results if I change each setting by a small amount?
- How many trades are in the sample, and is that enough? See strategy sample size and statistical significance.
If you cannot answer the first question, or the third answer is poor, the safest conclusion is that you have not yet found an edge.
5. Marketing Claims and Overfitting
Sellers of strategies, signals and indicators often show a historical equity curve. That curve may come from fitting the rules after the fact. Ask for live, time-stamped results from an account you can verify, and treat screenshots without that as marketing. See indicator accuracy myths and repainting.
Frequently Asked Questions
Is all optimisation overfitting?
No. Choosing sensible settings is normal. It becomes overfitting when you tune until the past looks good and then trust the result without testing new data.
How many rules are too many?
There is no fixed number, but each added rule should have a clear reason. If you cannot explain why it exists, remove it.
Can a demo account detect overfitting?
It helps, because the data is new to the strategy. It is still a small sample, so keep records and judge over many trades.
Does a simple strategy avoid the problem?
Simple rules lower the risk but do not remove it. You still need an out-of-sample test.
Related Reading
- Backtesting and Strategy Development -- how to test rules fairly
- Common Indicator Mistakes -- errors that lead to fitted setups
- Binary Options Advanced Strategy Stress Testing -- checking how rules behave under pressure
Compare brokers by available expiries: