use of MQLInfoInteger(MQL_OPTIMIZATION)

 

I'm trying to run some code if in a tester optimization. My code below doesn't seem to work and MQLInfoInteger(MQL_OPTIMIZATION) seems to be false. The function is called from OnTesterPass. Should that make a difference?

Cheers

E


void WriteTestResultsToFile(string& parameters_list[], int pass, ushort& data[])
  {
   string     optimised_params[];
   int        optimised_param_count    = 0;

//--- STORE PARAMETERS THAT ARE ENABLED FOR OPTIMIZATION
   if(MQLInfoInteger(MQL_OPTIMIZATION))
     {
      printf(MQLInfoInteger(MQL_OPTIMIZATION));
      for(int i=0; i<ArraySize(parameters_list); i++)
        {
         if(ParameterEnabledForOptimization(parameters_list[i]))
           {
            optimised_param_count +=1;
            ArrayResize(optimised_params, optimised_param_count);
            optimised_params[i] = parameters_list[i];
           }
        }
     }

 
Hi, did you ever figure out what was wrong? I see that noone replied. I have the same situation. I call a function from OnTesterPass() and in this function MQLInfoInteger(MQL_OPTIMIZATION),  MQLInfoInteger(MQL_FORWARD)  and  MQLInfoInteger(MQL_TESTER) are all false. Any advice would be apppreciated.
 
Goesta Torsten Hulden #:
Hi, did you ever figure out what was wrong? I see that noone replied. I have the same situation. I call a function from OnTesterPass() and in this function MQLInfoInteger(MQL_OPTIMIZATION)MQLInfoInteger(MQL_FORWARD)  and  MQLInfoInteger(MQL_TESTER) are all false. Any advice would be apppreciated.
MQLInfoInteger(MQL_FRAME_MODE) == true