EA Input parameters ignored in Tester if (Stop - Start) < Step

 
I want to run optimization of my EA where some parameters vary between Start and Stop value and one parameter does not vary. However, I want this one parameter to be different from the default value specified in the code ("extern ..."). In my example this as the useable account margin - in my source code the value was 0.1 (10% margin) and I wanted to run optimization with 0.05 (5% margin).

How can I do that?

Here's what I tried (and it did not work):
Start value = 0.05
Step = 1 (or 0.01)
Stop Value = 0.05

I was hoping that what this means internally, in the tester is something like:

for(param = Start; param <= Stop; ++param)
...

But this did not work - my entered value of 0.05 was not used, instead the default value from the source code was used. You can see that this is confirmed by the screen shots below and is also confirmed in the attached log file - this parameter is simply not used in the optimization.

I think this is wrong and should be changed because it does not allow the users to test a different value from the one provided ion the source code, only a range of values between start and stop, such that number of optimized values is > 1. I checked the checkbox by the parameter name that means it must be used! - even though the parameter does not vary between Start and Stop, it specifies a different value from the default value in the code and must be used.

I also tried entering 0 for the step but Tester does not accept 0.

Please tell me whether there is a combination of Start-Step-Stop values to accomplish this type of testing. If there isn't a easy way to accomplish this task w/o recompiling the EA - it is a limitation of the tester and in my opinion should be fixed in future versions of MT4.



---------------------

 
"The devil is hidden in trifles" (с) :)

 
Rosh - but if I exchange Step and Stop then I will get all the combinations between 0.05 and 1.00?

That's not what I want. I simply want to use the value 0.05 for my optimization (instead of the default value of 0.10 which is what g_fUseableMargin is initialized to in the source code of my EA). I understand that if I don't select the green checkbox by the variable - then the default value from the source will be used in the optimization. This is definitely correct behaviour.

However if I select the checkbox then the tester should always use the initial value (Start) in the optimization. After that, it should attempt to use Step to progress from Start to Stop. In my case Start + Step gives a value which is > Stop so the only value used during optimization (for g_fUseableMargin) should be the Start value 0.05.

The problem that I am reporting here is that the Tester ignores this value completely. You can see it in the log file - the lines where the tester prints a list of all parameters used for each pass of the optimization. Because g_fUseableMargin is not among these parameters I think that the tester simply ignores it, which most likely means that you are using a pre-condition when looping from star to stop

for(param = Start; param <= Stop; ++param)
...

, and all you need to do to fix it is change it to a post-condition, so that at least one iteration of this loop is always executed for each param:

do
{
...
}
while(param <= Stop)

I know that the actual code is much more complex, because it has to create these loops dynamically, based on the parameters, but you understand what I mean...
Reason: