Bug? MQLInfoInteger(MQL_OPTIMIZATION) appears not to be working - page 2

 
double OnTester(void)
 {
  double data[1];
  if(!FrameAdd("Test",(long)MathRand(),(double)MQLInfoInteger(MQL_FORWARD),data))
    Print(_LastError);

  return(MathRand());
 }
//---
void OnTesterPass()
 {
  ulong pass;
  string name;
  long id;
  double value;
  ResetLastError();
  if(FrameNext(pass,name,id,value))
   {
    printf("%llu: forward=%.0f",pass,value);
   }
 }
 
Alain Verleyen #:

Thank you Alain, your help is very appreciated.

I tested my code on another server, same code, same broker, same MT5 build. And it worked. But on my main server it still doesn't work. I isntalled a fresh MT5 and tested there. It still doesn't pick up the FORWARD flag. Do you have any ideas why that could be?

I would also like to ask about the pass numbers. I run Genetic Algo, so the number of tests in the OPT phase is around 10k. In the XML file that MT5 creates, the pass numbers are in that range, 1-10k, but the pass numbers I get from FrameNext() are completely different. I need those to match, but don't know how to make the code pick up the same Pass numbers as the XML does. Do you know why they differ and how to get the same Pass numbers as in the XML?


 
Goesta Torsten Hulden #:


I would also like to ask about the pass numbers. I run Genetic Algo, so the number of tests in the OPT phase is around 10k. In the XML file that MT5 creates, the pass numbers are in that range, 1-10k, but the pass numbers I get from FrameNext() are completely different. I need those to match, but don't know how to make the code pick up the same Pass numbers as the XML does. Do you know why they differ and how to get the same Pass numbers as in the XML?

AFAIK, MT5 does not provide a convenient way to match pass numbers in the tester report and in MQL5 API during genetic optimization (complete optimization provides equal numbers). MQ devs suggested to identify every pass by the set of parameters themselves.