Stop running EA on invalid inputs (Especialy on tester)

 

Hello.

How can i stop ea (don't lose time for testing) if an invalid input has placed???

Example: I use (for testing) for a macd a range of fastema 8-18 and for slowema 14-24. I don't want test the combinations that fastema>=slowema (14-14, 16-14, 18-14, 16-16, 16-18, 18-18).

I think place [OnInit] an "if (fastema>=slowema)" but i don't know what it must do then!!!!

Thanks.

 
chronisb:

Hello.

How can i stop ea (don't lose time for testing) if an invalid input has placed???

Example: I use (for testing) for a macd a range of fastema 8-18 and for slowema 14-24. I don't want test the combinations that fastema>=slowema (14-14, 16-14, 18-14, 16-16, 16-18, 18-18).

I think place [OnInit] an "if (fastema>=slowema)" but i don't know what it must do then!!!!

Thanks.

Place your test in OnInit() and return INIT_FAILED or INIT_PARAMETERS_INCORRECT. Like :

if (fastema>=slowema)
   return(INIT_PARAMETERS_INCORRECT);
 

Thank you very much.

 
Great and very usefull job! Thanks a lot....
Reason: