parameter get range and parameter set range function in MQL4

 

I would like to be able to exclude certain parameters from optimization if my 'main' parameters have a certain value. I found the ParameterGetRange() and ParameterSetRange() functions for MQL5.

Unfortunately I have to complete this EA in MQL4 where does functions do not exist. Does somebody have a clue on how to work around this?

To give a concrete example of what I mean:

I created a bool input to define whether stop loss will be moved or not.

Next I have a double input parameter that defines how much price must have moved in the right direction before the initial stop loss will be moved.

I want to be able to run an optimization where only if the Boolean function = true (meaning that the stop loss will be moved at some stage), the optimization will test the different input parameters for when to start moving the initial set stop loss.


Any thoughts???

Thanks!

 
Did you search the forum ? It has been discussed numerous times.
 

The simplest solution is to define a single parameter. If it is at 0 it is not used. In the code something like:


if (parameter> 0)
 {
 Do what you have to do
 So your passes to 0 are eliminated
 ........
 
thanks guys, will have a look at this. And yes I did search the forum which was how I found the mql5 solution. Let's see or I can resolve it now with the parameter condition
Reason: