Strategy optimization result do not match single run test result - page 2

 
Song Ming Da Ming Da #:

from Alain Verleyen  check the parameters are exactly the same ?
 sometime the GUI  transmitted   parameters wrongly when using "Run single test" command. ... Maybe loading the single one. forward parameters maybe get problem ><

And londing backward and forward maybe only run forward testing...
My solultion is always use backward and pickup the result we need ... I think this language/base system isn't robust  ><.

And My exp diff MetaTrade Build version get some diff issue , I have been get truble with it .Maybe after 2~3 month ,the bizarre problem disappear... ..
Maybe you do others ><,and check it later.

This is a classical/old bug on the Strategy Tester (only when running locally).  Which I already know for a very long time..

There is one solution:

1) stop using "Local Agents"

2) install Strategy Tester: https://cloud.mql5.com/en/download (and enable all the agents on your local machine)

3) configure MT5 to use Local Network Farm, and put the IP Address of your machine (or use 127.0.0.1 if you wish)


Run the optimization tests.. check any result using Single Test (from the optimization results table) and all of them WILL match.

No more wrong results, no more wrong optimizations.


The problem, from the OP, will be solved. Because it only happens when using Local Agents, but is fixed when using Local Network Farm (on the same computer)


Below is a picture, showing how to deactivate Local Agents, and activate Local Network Farm.

untick: Use Local Agents

Tick: Use Local Network Farm (which you have installed on the same machine that you are running Strategy Tester)


local net farm ticked

Download MetaTrader 5 Strategy Tester Agent to join MQL5 Cloud Network
Download MetaTrader 5 Strategy Tester Agent to join MQL5 Cloud Network
  • cloud.mql5.com
Join the MQL5 Cloud Network and earn extra income around the clock, while your computer works for you!
 
rrocchi #:

This is a classical/old bug on the Strategy Tester (only when running locally).  Which I already know for a very long time..

There is one solution:

1) stop using "Local Agents"

2) install Strategy Tester: https://cloud.mql5.com/en/download (and enable all the agents on your local machine)

3) configure MT5 to use Local Network Farm, and put the IP Address of your machine (or use 127.0.0.1 if you wish)


Run the optimization tests.. check any result using Single Test (from the optimization results table) and all of them WILL match.

No more wrong results, no more wrong optimizations.


The problem, from the OP, will be solved. Because it only happens when using Local Agents, but is fixed when using Local Network Farm (on the same computer)


Below is a picture, showing how to deactivate Local Agents, and activate Local Network Farm.

untick: Use Local Agents

Tick: Use Local Network Farm (which you have installed on the same machine that you are running Strategy Tester)



What classical/old bug ? How to reproduce it ?

Ok on local agents you said, but I can't reproduce it nonetheless.

 
I’d struggle using local network farm, my EA is supported by news data that I store in a local database, I’d need to find a way to pack the data within the bot.

In any case, I will try to run the optimisation using local farm to see if the issue disappears, if it does it sounds like it could be a cache issue, I have tested to use tester_no_cache,  tester_everytick_calculate and copybuffer on tick, none of them made a difference 

My bot has a long list of parameters, although I reduce the ranges for each of the parameters accordingly.

Someone mentioned in the past that the use of global variables could affect the result, my understanding is that each instance of the EA is running isolated from the rest, hopefully it should cover the case of overriding different values on variables.

On my case, I realised that I get different values on 2 cases:

From optimisation to run single result -> this produces different values
From single result without visualisation to use visualisation -> this produces yet another result

Some things I’d like to try next:
- Write a simplified strategy that I can share where it has a lot of parameters but a reduced number of indicators, ideally one and from the catalog available by default in the platform

 -Run my strategy with a limited number of parameters to try to isolate exactly which component is causing the issue

Thanks for the involvement folks

 
If anyone would like to pair with this issue, I’m happy to join 🙌🏼
 
Alain Verleyen #:

What are the results from optimization and from single run test ?

Did you check the parameters are exactly the same ? I have seen parameters wrongly transmitted when using "Run single test" command.

Did you try without the "forward" option ?

If you run several single test with same parameters, do you always have the same results ?

I am also having a problem with this, using local optimization. I made a post about some bugs (https://www.mql5.com/en/forum/454524) and this was one of them. I think what  Manuel Alejandro Cercos Perez about buffers was interesting. My code is based on the Expert Advisor (generate) option when you make a new EA. I don't know much about the code that is generated with this option maybe it generates some signals/indicators that have buffer problems or something. Is that a possibility?
MT5 forward testing bugs.
MT5 forward testing bugs.
  • 2023.09.23
  • www.mql5.com
This post is about a some weirdly related (I think) bugs that happen when forward testing optimized results. Please read through it all...
 
Alain Verleyen #:

What classical/old bug ? How to reproduce it ?

Ok on local agents you said, but I can't reproduce it nonetheless.

Been struggling with this discrepancy between the Back/Forward Results and Single Tests.

I'm going to try this now Alain.

If this works, I will give your lovely forehead a kiss!

 
Audi #:

Been struggling with this discrepancy between the Back/Forward Results and Single Tests.

I'm going to try this now Alain.

If this works, I will give your lovely forehead a kiss!

I've tried the Local Network Farm solution proposed but it didn't work for me.

The only solution that worked for me is downgrading the strategy tester.

Let us know your experience.

 
Francesco Baldi #:

I've tried the Local Network Farm solution proposed but it didn't work for me.

The only solution that worked for me is downgrading the strategy tester.

Let us know your experience.

Yes unfortunately the Local Farm did not work for me either.


@Franceso - I'm looking for a work around, what do you mean that you downgraded the strategy tester? 

As in using an old version of MT5, if so which one?

 
Audi #:

Yes unfortunately the Local Farm did not work for me either.


@Franceso - I'm looking for a work around, what do you mean that you downgraded the strategy tester? 

As in using an old version of MT5, if so which one?

Hi, Yes I'm using an older version of Strategy tester: build 4205.

I don't know if there are newer versions that work, I haven't tried them all. That one works for me.

Let me know if that works for you too, in that case, if you have a piece of code that can be used to reproduce the problem, you might attach it here for the support service to test. My project has many files and dependencies and couldn't manage to extract the portion that triggers the problem.

 

Up to now, I have read a lot of affirmations and assumptions, but I have never seen anyone providing evidence of an MT5 bug on this issue.

I am using MT5 Strategy Tester for optimizations of complex EAs and I don't have any issue or discrepancy between optimization/single test. (Using local agents only).


If someone want to work seriously on this, I am ready to help. But it needs at least an ex5 to reproduce the issue, the tester settings and all detailed informations needed.

And secondly, if the issue is happening, it can only be investigated from the EA source code, because there is NO general issue (it doesn't happen with all EAs).