MT4 optimization for indicator settings
-
I have created an EA which works in my strategy tester
However I want to optimize my EA to find the best settings to use on my indicators which I have figured out to do.
The problem is that I think there is two different pieces of code for the same indicator, because a crossover of one line in the indicator with another line in the second (identical) indicator is a signal.
The leads to me receiving two different numbers for the same setting of the indicator, which I wouldnt be able to use for forward testing without having two indicators on my charts, which I dont want.Is there any way to fix this so that the suggested settings to use for my one indicator is a fixed number?
-
@keshb96
Make a constant and use that in all blocks:

-
I tried compiling it after doing this and it comes up with an error saying 'compilation error' and 'constant expected'
-
It appears as though this is because I've ticked the boxes next to the constant to allow for optimization?
-
No worries, apparently those tickboxes dont matter as it still allows me to edit the input parameters for optimization in MT4
-
@keshb96 That's correct! The constants will always show up in mt4.
Personally I never use the tickboxes, they only mess things up.