goto end of EA

 

Hi,


I have 2 moving average EA, MA1 is faster then MA2, to save time in optimization, I want to skip permutation of MA1 >= MA2. 


void OnInit() 

{
        if (IsOptimization() ) {

                goto end_of_the_EA_code

        }

}

I could not find goto in MQL5, is there other loop function I can use? Is there other thing/code I should take note to go direct to exit the EA?


thank you for your help.

Documentation on MQL5: Constants, Enumerations and Structures / Named Constants / Predefined Macro Substitutions
Documentation on MQL5: Constants, Enumerations and Structures / Named Constants / Predefined Macro Substitutions
  • www.mql5.com
//| Expert initialization function                                   | //| Expert deinitialization function                                 | //| Expert tick function                                             | //| test1                                                            |...
 
Dilwyn Tng Zhuo Yu: optimization, I want to skip permutation of MA1 >= MA2.
int OnInit(){ if(MA1 >= MA2) return INIT_PARAMETERS_INCORRECT;
 
William Roeder:

Thank mate

Reason: