When optimizing an Expert Advisor in MetaTrader 5, it is very easy to focus on one number:
Profit.
Run an optimization, sort the results by net profit and choose the parameter set at the top.
Simple.
But during the development of TH Systems ATR Breakout, I learned that some of the most profitable optimization results were also some of the least useful.
The highest historical profit does not necessarily represent the strongest parameter set.
Sometimes, it represents exactly the opposite: a configuration that has adapted extremely well to a particular period of historical data.
The Optimization Trap
An optimization can test hundreds or thousands of parameter combinations.
Among such a large number of combinations, some will inevitably produce impressive historical results.
High profit.
A smooth equity curve.
A strong Profit Factor.
Low historical drawdown.
At first glance, these configurations can look like obvious winners.
But there is an important question:
Did we discover a genuine characteristic of the strategy – or did we simply discover the parameters that fit this particular historical period best?
This distinction has become an important part of how I develop my trading systems.
I No Longer Search for the Best Result
When I optimize ATR Breakout, my objective is not to find the single most profitable configuration.
Instead, I look at several characteristics together.
These include:
- Net Profit
- Drawdown
- Profit Factor
- Number of trades
- Losing streaks
- Behaviour across different market periods
- Stability of nearby parameter combinations
- Out-of-Sample behaviour
The last two points are particularly important to me.
If one very specific parameter combination produces an exceptional result while slightly different values perform poorly, I become suspicious.
A robust area of parameters is more interesting to me than one isolated optimization peak.
More Trades Are Not Automatically Better
Another lesson from development was that increasing the number of trades does not automatically improve a system.
This is particularly relevant because ATR Breakout operates on M1.
It would be relatively easy to relax the entry conditions and generate significantly more signals.
But that is not the objective.
Some days produce no valid setup.
Other days may produce several.
I would rather accept lower trading frequency than deliberately weaken the conditions simply to create more trades.
Trade quantity is not an optimization objective by itself.
The Out-of-Sample Test Changes Everything
After selecting interesting candidates from the optimization process, I test them on data that was not used during optimization.
This is where many impressive configurations suddenly become much less impressive.
I have seen parameter sets during the development of ATR Breakout that produced substantially better In-Sample results than the settings I ultimately selected.
Some of them failed completely when tested Out-of-Sample.
That experience changed the way I look at optimization results.
A lower-profit In-Sample configuration that continues to behave reasonably on unseen data can be much more interesting than the historical winner.
My Current Selection Process
My development process can be summarized as:
Idea → Optimization → Candidate Selection → In-Sample Analysis → Out-of-Sample Validation → Forward Testing
Optimization is therefore not the final answer.
It is primarily a tool for finding parameter regions worth investigating.
After that, the real work begins.
Configurations that only perform well under very specific historical conditions are less interesting to me.
Configurations that remain reasonably stable when conditions, periods or parameters change deserve further investigation.
Optimization Is Useful – Overconfidence Is the Problem
I don't think optimization itself is bad.
Quite the opposite.
MetaTrader 5 provides extremely powerful tools for systematic strategy development.
The danger begins when optimization results are treated as proof of future performance.
They are not.
A backtest tells us what happened under a specific set of assumptions, parameters and historical market conditions.
It cannot tell us what the market will do tomorrow.
That is why my objective with TH Systems is not to create the most impressive possible backtest.
The objective is to develop systematic trading rules, test them critically and understand where they fail.
Because sometimes the most valuable result of an optimization is not discovering what works.
It is discovering what doesn't.
TH Systems ATR Breakout
If you are interested in the EA used as an example in this article, you can find further information and the current settings on its MQL5 Market page.
TH Systems
Discipline · System · Edge


