Strategy Tester gives different Results with increasing Number of Parameter testet

 

Hello everyone,


I try to optimize the settings of an Indicator (in Combination with other Indicators) using an EA. When I use a low Number of parameter (setting Combinations) lets say something about 100, I get the same results for a specific Combination in Optimation and in visual mode/single Test.
But when I increase the Number of Combinations something about 700 or more. My Optimation Results are very different and dont give me the same Result as I get with the lower ammount of Combinations and in visual/singel test mode.

Does anyone have a clue what could be the issue there?
As I Say ists not a specific Optimation to visual mode difference it differ in the Optimation itsself.

The Input Parameter I test are allways the same. Just the span (like Period 2-50 -> 2 - 200) is change.

I attach two screenshots of the optimation results. As you see. The testet settings are the same (80-6-70) bute the result is completely different.

Thanks for your help in advance!

Processing optimization results using the graphical interface
Processing optimization results using the graphical interface
  • www.mql5.com
This is a continuation of the idea of processing and analysis of optimization results. This time, our purpose is to select the 100 best optimization results and display them in a GUI table. The user will be able to select a row in the optimization results table and receive a multi-symbol balance and drawdown graph on separate charts.
Files:
BW-Right.PNG  13 kb
BW-Wrong.PNG  10 kb
 
Thomas Behnke: I try to optimize the settings of an Indicator (in Combination with other Indicators) using an EA. When I use a low Number of parameter (setting Combinations) lets say something about 100, I get the same results for a specific Combination in Optimation and in visual mode/single Test. But when I increase the Number of Combinations something about 700 or more. My Optimation Results are very different and dont give me the same Result as I get with the lower ammount of Combinations and in visual/singel test mode. Does anyone have a clue what could be the issue there? As I Say ists not a specific Optimation to visual mode difference it differ in the Optimation itsself. The Input Parameter I test are allways the same. Just the span (like Period 2-50 -> 2 - 200) is change. I attach two screenshots of the optimation results. As you see. The testet settings are the same (80-6-70) bute the result is completely different. Thanks for your help in advance!

Are you using a fixed predefined custom period for the test or are you including the current dates, (e.g Last Month or Last Year)?

If you are using the current ranges such Last Month or Last Year, then don't. Use a predefined custom period time range that has a fixed start and end date.

Also, sometimes the problem is bugs in the code due to improper global variable initialisations.

 

Hi Fernando,


thanks a lot for your help and advice!

I use a fixed Period. So this shouldnt be an issue.


But I will check for bugs/ bad global variables. Do you have anything specific I should look at?
Double declarations or not used/empty variables?


Have a great day!

 
Thomas Behnke #But I will check for bugs/ bad global variables. Do you have anything specific I should look at? Double declarations or not used/empty variables?

Yes! Make sure that all globally scoped variables are properly initialised in the OnInit handler (or on first tick in OnTick). Don't assume or depend on their initial values set in their declarations.

This is because when EAs cycle (not unloaded/reloaded), globally scoped variables will often retain their previous values and are not necessarily reset to declaration values.

 

I will do this. Thanks again.

Maybe a dumb question but do I have to do this with arrays as well? for example resize them onInit or use ArraySetAsSeries or better ArrayFree?

The same Question for the Input variables ( for example: input int Period = 12;    or   input ENUM_APPLIED_PRICE InpAppliedPrice = PRICE_CLOSE;) do I have to recall this in the onInit Function as well?

Thanks für your help all the Way Fernando!


Greetings

 
Thomas Behnke #: Maybe a dumb question but do I have to do this with arrays as well? for example resize them onInit or use ArraySetAsSeries or better ArrayFree? he same Question for the Input variables ( for example: input int Period = 12;    or   input ENUM_APPLIED_PRICE InpAppliedPrice = PRICE_CLOSE;) do I have to recall this in the onInit Function as well?

Both resizing dynamic arrays and setting as series or non-series has to be done in the functions anyway. It is not something that is done in global declarations. If that is what you are doing (in the global declarations), then you need to fix that because it is totally incorrect.

As for EA parameters, obviously that is something that is set by the optimiser and it is not under your control. You do however have to test for their validity and report incorrect parameters by returning the INIT_PARAMETERS_INCORRECT condition.

 
Fernando Carreiro #:

Both resizing dynamic arrays and setting as series or non-series has to be done in the functions anyway. It is not something that is done in global declarations. If that is what you are doing (in the global declarations), then you need to fix that because it is totally incorrect.

No No ^^Its not what I do. I was just wondering if I have to. So This wont be a Problem.

Fernando Carreiro #:

As for EA parameters, obviously that is something that is set by the optimiser and it is not under your control. You do however have to test for their validity and report incorrect parameters by returning the INIT_PARAMETERS_INCORRECT condition.

That is a very good hint and I will incldue this in my code.


thanks again for your quick help and your good informations!

 
Thomas Behnke #: thanks again for your quick help and your good informations!
You are welcome!
 

Update:
I could break it down....

I do a Backwards (6 years) and a forward (3 Years) test in Optimation. The Forwardtest gives the same results in Optimation as in Visulalzation. The Backward Test does not. I have the clue that it depends on the number of passes.... everything above 256 will give different results every time I run it.
Do you guys have any experience with something like that?

 
I met similar problem before. I found that it was because of wrong ArrayResize() . The unused slots generate very small random numbers instead of being 0 or null or compiler error. So you would like to check if you count the wrong size of an array.
 

Hi Yinglin Tang,


Thanks for your advice!
It seems to be an error of an Indicator that I call with the icustom function. I tested my Code with diffrent indicators and it only apears on some/this one in paticualar.... now I have to find out, what this indicator is doing wrong I guess....


Anyone knowing what could be wrong with this indicator or having trouble with it in the past? I havent done indicators jet so I dont know much about them :S


https://www.mql5.com/en/code/1500


have a great day everybody!

AbsoluteStrength
AbsoluteStrength
  • www.mql5.com
The oscillator that displays strengths of Buyers (Bulls) and Sellers (Bears) separately.
Reason: