Saving Deal information from each pass of an MT5 Optimization

EdFuk
51
EdFuk  

Hi,


I'm struggling and wondered if someone can help?


I'm running MT5 from Python using the command line and a config file. I'd like to be able to read in equity curve data from each pass in the optimization. I'm not familiar with Frames and can't really see any good documentation on their use. Can frames be used to get the deal data for each pass or is it just statistics? 


I've tried accessing deal data using HistorySelect() from the OnTesterPass but this doesn't appear to work, should it? I can't seem to create and save a file at all from the OnTesterPass() event. Here my code to try and at least save a file from the function:


void OnTesterPass()
  {
//--- IF WRITING OF OPTIMIZATION RESULTS IS ENABLED
   static int pass = 1;

   int outputFileHandle = INVALID_HANDLE;
   string outputFileName = "deals" + IntegerToString(pass) + ".csv";
   outputFileHandle = FileOpen(outputFileName, FILE_WRITE|FILE_CSV, "\t");

// WRITE DEAL DATA HEADER TO FILE if IF FIRST PASS
   FileWrite(outputFileHandle, pass);
   pass += 1;
   FileClose(outputFileHandle);
  }

Any ideas?


Cheers,

Ed