Forward optimisation freezes when skipping passes using INIT_PARAMETERS_INCORRECT

 

Hi Everyone,


I am performing a slow complete algorithm optimisaiton on an EA. 

The EA contains a boolean which if activated returns INIT_PARAMETERS_INCORRECT in the OnInit function when invalid combinations of parameters are encountered by the tester.

(E.g. no stoploss + stoploss = 10 pips). 

The intention is to reduce the number of passes that the tester runs; thereby greatly reducing the testing time and resulting data. The works well for backtesting optiomisation. However on the forward optimatision passes, the tester freezes around halfway. 

Please see below a subsection of the code The code in full tests more parameters but for ease of understanding you get the point from the below.

Would anyone know why this could cause the forward tester to freeze please?

Interestingly, I have noticed that if you replace INIT_PARAMETERS_INCORRECT with INIT_FAILED the problem does not present. However in doing so the tester does not include the invalid passes as ‘0’ in the results which makes it difficualy to verify if passes have been legitimately skipped or not, whihc is not ideal


Thanks in advance for your consideration.


int OnInit()
  {
   if(skipInvalidParameters)
     {
      if(inpMagicNumber <= 0)
        {
         Print("MagicNumber <= 0");
         return INIT_PARAMETERS_INCORRECT;
        }

      if(inpRangeStartHours < 20)
        {
         Print("inpRangeStartHours is too early");
         return INIT_PARAMETERS_INCORRECT;
        }
     }
  }