Run Single Test x Strategy Tester

 

Gents,

 

I'm running backtests using the 'Run Single Test' function directly from the Optimization Results tool and the Strategy Tester with the same parameters, but the results are significantly different. Has anyone else experienced this? Any insights on why this might be happening?"

 
Clayton Barros:

Gents,

 

I'm running backtests using the 'Run Single Test' function directly from the Optimization Results tool and the Strategy Tester with the same parameters, but the results are significantly different. Has anyone else experienced this? Any insights on why this might be happening?"

Hi there,

it's definitely happening and being a major issue to me.

I did this post https://www.mql5.com/en/forum/465803

but it seems that nobody from the metatrader support staff did care about this.

It's definitely a strategy tester bug, because if you use an older version it works as expected. I'm using build 4205 now.

If you have a piece of code to reproduce the problem it might help, I have a huge project with tons of files and dependencies and couldn't manage to extract the portion that triggers the problem.

Optimization results not matching Single Test run
Optimization results not matching Single Test run
  • 2024.04.18
  • Francesco Baldi
  • www.mql5.com
Hi everybody, I'm experiencing a problem with Metatrader 5 optimizer which I've never encountered before. I don't know since when this is happening...
 
Francesco Baldi #:

Hi there,

it's definitely happening and being a major issue to me.

I did this post https://www.mql5.com/en/forum/465803

but it seems that nobody from the metatrader support staff did care about this.

It's definitely a strategy tester bug, because if you use an older version it works as expected. I'm using build 4205 now.

If you have a piece of code to reproduce the problem it might help, I have a huge project with tons of files and dependencies and couldn't manage to extract the portion that triggers the problem.

Hey Francesco,

Apparently, we´re facing different issues. I’m experiencing issues with significant differences ( trades, results, etc ) from the Optimizer Report ( obtained from the Single Test function )  when compared to the Strategy Tester ( Optimization disabled ).

Apparently, your issue is that the Optimization Results differs from the Optimizer Report, which is not my case.

 
Clayton Barros #:

Hey Francesco,

Apparently, we´re facing different issues. I’m experiencing issues with significant differences ( trades, results, etc ) from the Optimizer Report ( obtained from the Single Test function )  when compared to the Strategy Tester ( Optimization disabled ).

Apparently, your issue is that the Optimization Results differs from the Optimizer Report, which is not my case.

Hi Clayton,

so the stats that you see in the optimization result list match the single test results when you run a single test, but if you manually load the same parameters you are getting different results?

Did I get it right?

 
Clayton Barros:

Gents,

 

I'm running backtests using the 'Run Single Test' function directly from the Optimization Results tool and the Strategy Tester with the same parameters, but the results are significantly different. Has anyone else experienced this? Any insights on why this might be happening?"

If your EA has a custom indicator, that's probably the issue. I had an issue where a bad coded indicator would work perfectly fine on live charts/visual testing. When optimizing, however, some bars would just be calculated as EMPTY_VALUE where it should have some value. That's because the indicators work differently on the visual mode and non-visual mode - don't ask me what exactly is different, I just know it is from my testings.

If that's your case, check if the indicator is well coded (i.e., if you do your look back like int i = rates_total-1, this issue may happen; just do your look back from prev_calculated like this: int i = prev_calculated-1 - just an example, because the issue source may be something else)

 
Francesco Baldi #:

Hi there,

it's definitely happening and being a major issue to me.

I did this post https://www.mql5.com/en/forum/465803

but it seems that nobody from the metatrader support staff did care about this.

It's definitely a strategy tester bug, because if you use an older version it works as expected. I'm using build 4205 now.

If you have a piece of code to reproduce the problem it might help, I have a huge project with tons of files and dependencies and couldn't manage to extract the portion that triggers the problem.

As it was already said to you in the other topic, if you want to be taken seriously by MetaQuotes, you need to provide source code and all details to reproduce the issue.

Otherwise you will be ignored.

 

Do you use CopyBuffer to access a custom indicator without checking its returned value?