EA's Recommendation ④: Thoughts on Overfitting, with a discussion including a case where I deliberately tried it
Good morning everyone. I’m Renmi.
It’s surprisingly the fourth article. Honestly, around the time I wrote the previous article I thought, “Maybe this is the last one.” However, someone left a comment on X (formerly Twitter) saying, “I’m glad to read your article.” It’s just one comment, but it was enough to make me want to write another piece. So I’m at my computer again this time as well.
Last time, I wrote about my thoughts on the difference between discretion and the expected value of EA, including opinions from a friend who is a billion-dollar trader. If you haven’t read it yet, please use the URL below.
https://www.gogojungle.co.jp/finance/navi/articles/82912
Now, the topic this time is “overfitting.” Normally, overfitting is something to avoid. However, I would like to proceed with the discussion while incorporating experiments that ask, “What if we deliberately tried it the other way around?”
What is overfitting?
Overfitting, in simple terms, is when you overly optimize the EA’s logic to fit past data.
For example, many people have seen EAs with abnormally high win rates in backtests: “Win rate 90% over the last 10 years! Drawdown almost zero!” But such EAs typically do not work in real trading.
Why?
Because the EA is over-optimized for the “past market,” and cannot adapt to the “future market.”
The relationship between optimization and overfitting in EA development
I believe overfitting is the biggest enemy for EA developers.
During the EA development process, we perform “optimization.” Optimization is adjusting parameters to improve the EA’s performance—for example, fine-tuning moving average periods, RSI thresholds, entry timing, and so on.
However, there is a trap of overfitting here.
Experienced developers balance optimization to create a more generalizable logic. But when beginners optimize, they often end up with an EA that only fits a specific past dataset and does not work at all in future markets—an “overfitting EA.”
What if we deliberately overfit, in the opposite direction?
“What if we deliberately overfit to see how far we can go?”
That question popped up suddenly.
Overfitting is something to avoid normally, but “if we overfit to the extreme, what kind of EA would we get?” “And would it still work in future markets?”
My curiosity got the better of me, and I decided to experiment.
Method of experiment
What I did was simple.
Create an Over-Optimization Tool in Python
Develop a tool that analyzes the selected EA’s parameters and iteratively optimizes to maximize backtest results to the extreme.
Create a suitable breakout EA
A simple logic that enters when the most recent high/low is broken, and takes profit/stop loss at a fixed range.
Feed the EA into the over-optimization tool
Perform extreme overfitting on the period from 2005/08/01 to 2020/07/31.
Results of verification
1. Period of excessive optimization (2005/08/01–2020/07/31)
When backtesting the resulting EA during the over-optimization period, it produced a clearly upward-sloping, right-trending performance.
Win rate:96.31%
Profit factor:8.57
A perfect upward-sloping equity curve
Doesn’t this look like a perfect EA? It seems like the strongest EA that perfectly fits past markets has been born.
2. Future markets (2020/08/02–2023/07/21)
So what would happen if we backtest this EA outside the period of over-optimization?
Win rate:77.97%
Profit factor:1.15
Equity curve becomes unstable and profits are not substantial
The win rate drops significantly and profits become meager. It is a quintessential example of an “EA optimized for past data but not usable in the future.”
What happens to people with low literacy?
If this EA were being sold, how would people with low literacy in FX or EAs react?
“Win rate of 96% in backtests?! This is an incredibly profitable EA!”
Thinking that and purchasing, when real trading begins…
“We’re not winning at all… we’re actually losing…”
Thus, funds are lost.
Many fraudulent EAs use such over-optimized backtest results to deceive beginners and sell them. When choosing an EA, be sure to check not only backtest results but also forward testing and real trading performance.
Real trading performance of the GTX EA
Regarding forward testing and real trading performance, the GTX EA I sell has achieved the following in real trading. Please take a look.
Profit factor: 1.62
(Real-trade data from 2021/12/13–2025/02/01)
GTX real-trade performance https://real-trade.tech/accounts/52392
GTX sales site https://www.gogojungle.co.jp/systemtrade/fx/34527
Conclusion
Through this experiment, I reaffirmed how dangerous overfitting can be.
Even if an EA is perfectly fitted to past data, it does not necessarily work in future markets
Optimization is necessary, but overdoing it creates a deceptive performance beyond the true capabilities
EA’s most important goal is to survive in future markets
When choosing an EA, also look at forward testing and real operation in addition to backtesting
What we, as EA developers, can do is not create “EA that fits past data,” but “EA that can compete in future markets.”
Well then, see you in the next article.!
Renmi’s EA List
https://www.gogojungle.co.jp/users/189446/products
The following is a paid zone, but there isn’t anything particularly useful written there.I just wanted to try using the tipping feature.