The problem is: results when using the "Start" button are very much different to the results when double-clicking the results table. Why?
Forum on trading, automated trading systems and testing trading strategies
different results in optimization and single test
Fernando Carreiro, 2023.06.21 16:21
99% of the time it is due to a bug in the EA code.
One possible cause that used to happen to me, was about Globally scoped variables not being properly initialised in the OnInit().
Forum on trading, automated trading systems and testing trading strategies
No trades open during strategy optimization
Fernando Carreiro, 2023.02.24 14:08
One common cause for optimisation passes to be different from individual back-test runs, is globally scoped variables that are not properly initialised in functions and only initialised in their global declarations.
The reason is that the EA's global variables are not reinitialised based on their declarations on every new optimisation pass (I don't know if this is a bug or intentional, but it is what happens).
So, make sure you initialise all your globally scoped variables in the OnInit() event handler if they are not initialised elsewhere in other functions
However, that is just one possible cause. It is only a guess. If you want an informed answer, then you will have to provide the actual source code of the EA that has this issue.
Forum on trading, automated trading systems and testing trading strategies
No trades open during strategy optimization
Fernando Carreiro, 2023.02.24 17:23
Yes, but I not always. I don't know the exact conditions for it to be recreated.
All I know is that it happened to me often on both MT4 and MT5 in the past, until I started making sure to initialise at runtime instead of only declaratively.
EDIT: It also sometimes happened on Indicators when they reload on a chart due to a recompile. Again, not always, but sometimes.
Here is my situation:
I activate the visualization in the Settings tab.
I run MT5 optimization with back and forward split (3 years + 1 year).
before you automaticly go to recoding anything, you should close mt5 and try cleaning mt5 first by deleteing all your test folders and caches, and redoing your optimisation tests.
It is my experience that when doing a long test such as this, fragmented history files sometimes will trip mt5 into doing inconsistent and unpredictable "things". You could try to defragment these files by copying the folder "Tester" to a different drive, and then deleting the original folder and copying back the folder from the 2nd location; but it is probably just as easy and to maintain your health of sanity -- to simply delete the test folder and ensure agents folders are also deleted -- is the only way to ensure these files are not too fragmented -- as redownloading history will fragment these files again, but hopefully, not so much as the previous time.
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Here is my situation:
I activate the visualization in the Settings tab.
I run MT5 optimization with back and forward split (3 years + 1 year).
I get the results and go to the Optimization Results table.
I double-click a line to simulate that set.
I get the optimization result in the MT5 terminal, and the forward result in the window opened by MT5 where I can see the trades, etc.
Then I click the green Start button to rerun the same set, and visualize the optimization results in a window as well.
This time, I get the two windows, one for the optimization pass, and another for the forward pass.
So far so good.
The problem is: results when using the "Start" button are very much different to the results when double-clicking the results table. Why?
This is more pronounce when the period is PERIOD_D1.
FYI: I am using MT5 build 5430 on Linux.
I appreciate your insight.