Optimization problem

 
I have an EA that have 3 Moving Average, called MA_1, MA_2, MA_3. My question is:
I have to optimize juts the period of the 3 MA, such that MA_1 goes from 3 to 100, MA_2 goes form 4 to 100, MA_3 goes form 3 to 100, but I need to avoid the calculation of all the result that have MA_1>MA_2 && MA_2>MA_3.
Example:
If MA_1=5, MA_2=6, MA_3=14, it's fine, than calculate the result. if MA_1=5, MA_2=26, MA_3=12, that's wrong, don't calculate the result and go on.

How can i tell to the optimizer my rules?

Thanks whoever aswer in advise.
 
DiDi:
I have an EA that have 3 Moving Average, called MA_1, MA_2, MA_3. My question is:
I have to optimize juts the period of the 3 MA, such that MA_1 goes from 3 to 100, MA_2 goes form 4 to 100, MA_3 goes form 3 to 100, but I need to avoid the calculation of all the result that have MA_1>MA_2 && MA_2>MA_3.
Example:
If MA_1=5, MA_2=6, MA_3=14, it's fine, than calculate the result. if MA_1=5, MA_2=26, MA_3=12, that's wrong, don't calculate the result and go on.

How can i tell to the optimizer my rules?

Thanks whoever aswer in advise.


If "MA_1", "MA_2" and "MA_3" are input parameters, then you can do this:

//+------------------------------------------------------------------+
//| Expert initialization function                                   |
//+------------------------------------------------------------------+
int OnInit()
  {
   if(MA_1=5 && MA_2=26 && MA_3=12)
      return(INIT_PARAMETERS_INCORRECT);
 
Thanks you, that warked for me.