Optimization results not matching Single Test run - page 2

 
APic83 #:

Hi Francesco, 

did you find a solution, explanation or any workaround other than downgrading? I'm struggling with the same issue.


Thanks

The problem is almost always in the EA code : https://www.mql5.com/en/forum/376067
Strategy optimization result do not match single run test result
Strategy optimization result do not match single run test result
  • 2021.08.22
  • www.mql5.com
Get huge deviation, not sure it's optimization get error or single run get error. Win 10 , get once unexpected update. (optimization results should match the non visual test results though, if they don't then, the ea code may have some forced changes of behaviour when it's on optimization mode) there are something to note
 
APic83 #:

Hi Francesco, 

did you find a solution, explanation or any workaround other than downgrading? I'm struggling with the same issue.


Thanks

Hi there,

many people wrote me, also in private, about this topic and asking for help.

Unfortunately I cannot help, in my case there was definitely something wrong in the tester engine causing internal errors to happen and being stored in the _LastError variable.

So I eventually managed to work around this issue resetting the error status before every call to core functions, and checking for 'real' errors only.

I don't know if that's your case, if you don't make use of global variables or other shared resources you might have been caught as well, and you could try investigating in that direction.

This is the link to the issue breakdown and the solution I adopted.

https://www.mql5.com/en/forum/376067/page5#comment_54267478

Cheers

Automated trading systems and testing of trading strategies.
Automated trading systems and testing of trading strategies.
  • 2024.08.11
  • www.mql5.com
Forum on trading, automated trading systems and testing of trading strategies. I use ctrade class, so all prices in buy, buylimit, buystop, sell, selllimit, sellstop, positionmodify functions i pass it adjusted
 
Francesco Baldi #:

This is the link to the issue breakdown and the solution I adopted.

https://www.mql5.com/en/forum/376067/page5#comment_54267478

From that same thread, this post seems enlightening:

Forum on trading, automated trading systems and testing trading strategies

Strategy optimization result do not match single run test result

Stanislav Korotky, 2025.12.13 15:41

GetTickCount is a system real timer, while the tester simulates internal timing based on history of ticks and their playback (in visual or fast mode). During one tick of the real timer the tester can replay a thousand of historical ticks.

TimeCurrent is simulated by the tester.

That could certainly explain why I don't experience the issue with an EA that evaluates, trades on, and backtests on OHLC prices only.