Download MetaTrader 5

Set input variable stop

To add comments, please log in or register
zifu wang
637
zifu wang  

Can I set the stop of one input variable Inp_Signal_TwoEMAwithITF_PeriodFastEMA to another Inp_Signal_TwoEMAwithITF_SlowFastEMA?(Inp_Signal_TwoEMAwithITF_PeriodFastEMA <= Inp_Signal_TwoEMAwithITF_SlowFastEMA)

Alexey Da
Moderator
6639
Alexey Da  
What exactly would you like to do?
zifu wang
637
zifu wang  
alexvd:
What exactly would you like to do?

 

 tester

I wanna to set the stop of Inp_Signal_TwoEMAwithITF_PeriodFastEMA to another variable Inp_Signal_TwoEMAwithITF_PeriodSlowEMA, instead of specific figures.

please advise. 

Alexey Da
Moderator
6639
Alexey Da  

If I get the picture right you would like not to run optimization pass when value of Inp_Signal_TwoEMAwithITF_PeriodFastEMA is more then value of Inp_Signal_TwoEMAwithITF_PeriodSlowEMA.

You can add 'if' statement in OnInit function which returns non-zero result for the OnInit function. In this case optimization pass finishes with error.

if(Inp_Signal_TwoEMAwithITF_PeriodFastEMA>Inp_Signal_TwoEMAwithITF_PeriodSlowEMA)
     {
      printf("Value of Inp_Signal_TwoEMAwithITF_PeriodFastEMA (%d) musn't be more then Inp_Signal_TwoEMAwithITF_PeriodSlowEMA (%d)",
             Inp_Signal_TwoEMAwithITF_PeriodFastEMA,
             Inp_Signal_TwoEMAwithITF_PeriodSlowEMA);
      return(1);
     }
zifu wang
637
zifu wang  
alexvd:

If I get the picture right you would like not to run optimization pass when value of Inp_Signal_TwoEMAwithITF_PeriodFastEMA is more then value of Inp_Signal_TwoEMAwithITF_PeriodSlowEMA.

You can add 'if' statement in OnInit function which returns non-zero result for the OnInit function. In this case optimization pass finishes with error.

alexvd, thank you so much.
To add comments, please log in or register