Conditional Parameter Optimization solution needed! - page 2

 

To allow genetic optimization run through where I have a lot of undesired input combinations I usually introduce an "error" variable instead of returning INIT_PARAMETERS_INCORRECT, and then I cehck that var first thing in the OnTick and if true then return before any other logic is evaluated, that way the pass will pass but will make no trade and will be fairly quick. It's not pretty, but usually works:

bool error;

int OnInit(){
   error = false;
   if(input_combo_undesired){ //whatever condition you need to identify wrong conditions
      error = true; //this is instead of return(INIT_PARAMETERS_INCORRECT);
   }
   ...
   return(INIT_SUCCEEDED);
}

void OnTick(){

   if(error){
      return;
   }
   ...
   //rest of logic here that is ignored if error = true
   ...
}