Tuning EA parameters too precisely to historical data, producing a strategy that backtests well but performs poorly on unseen data because it exploits noise rather than real market patterns.
also: curve-fitting, over-optimisation, data mining bias
Updated · Reviewed
In plain English
Tuning the rules until they fit the past so closely that they have learned its accidents rather than its patterns. The backtest gets better while the strategy gets worse, and nothing in the report distinguishes the two.
Why it matters
Overfitting is the failure mode that produces beautiful evidence, which is why it survives review that a bad strategy would not. Every optimisation pass improves the reported result whether or not it improves the strategy, so a process that only ever looks at the reported result cannot tell the difference.
✓It explains the most common EA disappointment: excellent backtest, mediocre or losing live account, with no bug to find. Nothing broke — the tuning was measuring the sample.
✓It gets worse the harder you work. More parameters, more optimisation passes and more candidate strategies all increase the chance that the winner won by fitting noise.
✓It cannot be detected from the winning run. The only evidence that separates a real edge from a fitted one is performance on data the tuning never saw, which has to be reserved before the tuning starts.
Using it to validate a strategy
Where it is used
Judging whether an EA's published backtest is evidence of an edge or evidence of tuning.
Deciding how many parameters a strategy is allowed to have before it is optimised at all.
Interpreting the gap between in-sample and out-of-sample results in a walk-forward run.
Explaining why a strategy that led an optimisation table degrades as soon as it is deployed.
What a reliable result looks like
✓The reported window includes data that was untouched while the parameters were chosen.
✓The strategy has few parameters, and each one corresponds to something a trader could explain without reference to the backtest.
✓Nearby parameter values perform similarly. An edge that survives only at one setting is a property of the sample.
✓The rules work, with the same settings, on instruments and periods they were not selected on.
✓The number of strategies tried before this one was chosen is known, because the winner of a large search is expected to look good by chance.
Warning signs
!Parameters at implausible precision — a 37-period average, a 23.7-pip stop — where a round value would perform almost the same if the edge were real.
!A win rate above 90% or a Sharpe above 3 on a multi-year backtest with no forward record.
!Results shown only on the single instrument and window the parameters were selected on.
!A performance surface with a lone sharp peak rather than a broad plateau.
!No mention of how many variants were tested before this one was published.
Backtest vs live trading
The live account is the first genuinely out-of-sample test, which is why the drop appears immediately rather than gradually.
A fitted strategy usually degrades toward breakeven-minus-costs rather than to a dramatic loss, which makes it easy to explain away as a bad patch.
The size of the in-sample-to-live gap is the measurement. A moderate drop is normal for any strategy; a collapse through breakeven is the signature.
Re-optimising after the drop restores the backtest and repeats the cycle, which is the trap the process creates.
Recommended validation method
1Reserve an out-of-sample window before touching a parameter, and look at it once, at the end.
2Prefer fewer parameters with defensible meanings over more parameters with better results.
3Check the neighbourhood, not the peak: take the centre of a broad plateau rather than the top of a spike.
4Re-test the finished settings on other instruments and other periods without adjusting them.
5Use walk-forward analysis when the strategy genuinely needs re-fitting over time, so the re-fitting is part of what is being tested.
Example
An optimiser reports the ten best parameter sets for a strategy. The top row is the one that gets published; the shape of the table around it is what actually says whether the edge is real.
Best in-sample setting (period 37)
PF 2.41
Neighbouring settings (periods 35–39)
PF 0.94–1.06
A one-step change destroys the result — the peak is a spike, not a plateau.
Same setting, untouched out-of-sample window
PF 0.88
A real edge degrades gently as parameters move away from the optimum. A fitted one falls off a cliff, and the cliff is visible before any out-of-sample data is spent.
Calculation2.41 in-sample → 0.88 out-of-sample, while neighbours sit at breakeven
ResultThe 2.41 was a property of the window, not of the rules
How to interpret it
Overfitting is diagnosed from the process that produced the result, not from the result. Ask what was tuned, on what, and what was held back.
Range
What it means
One window, all parameters optimised, nothing reserved
The report has no evidential value about the future. It describes how well the rules can be bent to a sample.
Out-of-sample window reported but re-used after each adjustment
The reserve has been spent. Once results from it feed back into tuning, it is in-sample too.
Single untouched out-of-sample window, looked at once
The minimum standard. Interpret the gap rather than the level.
Walk-forward with a broad parameter plateau and cross-instrument checks
The strongest evidence available before live deployment, because the re-fitting itself was tested.
Count the strategies tried, not just the parameters. Testing two hundred ideas and publishing the best one is a search whose winner is expected to look good by luck.
Round the published parameters and re-run. If the result mostly survives, the precision was cosmetic; if it collapses, the precision was the edge.
Judge the parameter surface rather than the peak. Breadth is the property that transfers to unseen data.
mt5depot listings state their data window, tester model and trade count, so a reader can ask the questions above rather than take the curve on trust.
Common mistakes
✕Reusing the out-of-sample window
Each time a result from the reserved window informs another adjustment, that window becomes part of the training data. After a few rounds there is no out-of-sample left, and the process feels more rigorous while proving less.
✕Treating a high Sharpe or win rate as evidence against overfitting
Those are exactly the figures fitting inflates. An in-sample Sharpe above 3 on a retail EA is more likely to be a symptom than a reassurance.
✕Believing few parameters make a strategy safe
Parameter count is one route; strategy selection is another. Choosing the best of two hundred simple strategies on the same window fits the sample just as effectively as tuning one complicated strategy.
✕Re-optimising after live performance disappoints
It restores the backtest and repeats the failure, because the new fit is drawn from the same process that produced the old one. The question to answer first is whether the original edge was ever out-of-sample.
In depth
What fourteen published backtests can and cannot settle
Across the 14 EAs published here
Figure
In-sample profit factor
1.27–1.52
Listings with a profit factor below 1.00
0
Reporting an out-of-sample block
11
Out-of-sample return
−0.57% to +3.01%
Out-of-sample blocks that lost money
2
Verified runs on a real-money account
0
Read the last row before the first. A rolling backtest still runs on history someone
could have inspected, so nothing above is out-of-sample in the sense that decides
anything — and three EAs declared a reserve start date and have published no result
since, which is what reporting bias looks like from the inside.
Size, not sign, is the weak point. The median in-sample record here is 362 closed
trades; the median reserved block is 21. A run that short cannot separate an edge from
a quiet quarter, which is why the small negatives (−0.57%, −0.47%) carry no more
verdict than the positives.
The Strategy Tester’s Forward dropdown (No, 1/2, 1/3, 1/4, Custom) splits the interval
for you. It cannot stop you re-reading the forward half after every optimisation pass,
and re-reading it is what spends it. Set Forward to Custom with the date you stopped
looking — 2026-04-01 for ten of the blocks above — and the reserve is worth only what
falls inside it: 142 trades for Cairn, 40 for the next largest, single figures for two.
Frequently asked questions
How can I tell if an EA is overfitted before buying it?
Look at the process rather than the curve. Ask whether any window was held back while the parameters were chosen, whether the settings are round or implausibly precise, whether nearby parameter values perform similarly, and whether the rules were ever tested on an instrument they were not selected on. An unanswered question here is itself the answer.
Does using fewer parameters prevent overfitting?
It helps but does not prevent it. Selecting the best-performing strategy out of many candidates on the same data fits that data even when each candidate is simple, so the number of ideas tried matters as much as the number of knobs on any one of them.
Is optimisation always bad?
No — a strategy has to be given some settings, and choosing them from history is reasonable. What separates optimisation from overfitting is whether anything was reserved to check the choice against, and whether the chosen setting sits on a broad plateau rather than a spike.