"How to detect over-optimization with AI" (1/20) Investment AI development struggle diary
Backtesting is great, but...
If you’re an EA user, you’ve probably had this kind of experience, right?
If you’re developing EAs, you likely have 99 out of 100 that end up like this.
Overfitting refers, in simple terms, to
“the phenomenon where parameters are tuned too tightly to a specific period of data, making them unfit for future data.”
An EA that performs well in backtests may be completely unusable in reality due to overfitting, right?
What causes overfitting?
The main causes are data characteristics that only exist within the backtest period and noise, to which the EA becomes excessively adapted.
During the test period, it yields excellent results, but those performances are not reproduced in future data.
I call thisnoise fitting.
https://x.com/firs*****_peace/status/1878707246831641018
While forward testing can mitigate this issue to some extent,the same problem actually occurs during the forward test period as well.
The more you increase the test period, the more it ends up fitting the forward test period instead.
If period A is backtest and period B is forward test, they fit AB and do not fit period C.?
This is no different from backtesting in the AB period
Detecting overfitting with AI
This is where AI comes in!
With AI,you can learn the relationship between parameters and profitabilityand detect overfitting to some extent?
? Steps
① Collect as much optimization results as possible. (More parameters and more samples are better)
② Do supervised learning. (Use parameters as features, profit as the target variable)
③ Compare with AI predictions (Make AI predict profit from parameters where profit is known)
④ Assess the reliability of the result profit (If actual profit and AI-predicted profit are close, reliability is high)
⑤ Detect overfitting parameters (Actual profit that deviates greatly from AI’s prediction may indicatenoisepossibility of a fluke)
Why is using AI beneficial?
AI is good at uncovering data patterns that humans cannot grasp.
In MT5 optimization, it’s often unclearwhether you need to look at a 3D graph to study the relationship between parameters and profit
Reviving expired EAs
With this approach, interestingly, expired and unused EAscould be revived.
There are manyfree EAsthat could drastically change their performance in the future
If you’re a developer, you can escape theparadise of parameter tuningduring the development phase
If you’re wondering, “My backtest results differ too much from real trading!” please try this method.
Supervised learning with AI is relatively easy to use, so we’re developingan appfor you ☺️
Let’s use this method to build a future-proof EA together!