Download MetaTrader 5
To add comments, please log in or register
Do you often publish source codes? Find out how to do that correctly!
APeng
359
APeng 2014.08.31 11:28 

Hello,

I export the balance during optimization:

if(   IsOptimization()  == true
   && AccountBalance()  != AccountBalance_old
  )
   {
     AccountBalance_old = AccountBalance();
     int handle = FileOpen("Optimization Balance.csv",FILE_WRITE|FILE_READ|FILE_CSV);
     FileWrite(handle,"Balance"); 
     FileSeek(handle, 0, SEEK_END);
     FileWrite(handle,AccountBalance());
     FileClose(handle);
   }

Is there a way to identify the number of the current optimization pass?

FileWrite(handle,"Number","Balance"); 
FileSeek(handle, 0, SEEK_END);
FileWrite(handle,number,AccountBalance());


I am using an old build 401.

Thanks!

Carl Schreiber
5935
Carl Schreiber 2014.08.31 13:01  
APeng:

I am using an old build 401.


How do you do that? Would be very interesting!!


Gooly

APeng
359
APeng 2014.08.31 13:50  
gooly:

How do you do that? Would be very interesting!!


Gooly


I use it offline. So no updates are made. For backtesting.
APeng
359
APeng 2014.08.31 14:03  
void export_optimization()
{
  if(   iVolume(Symbol(),Period(),0) == 1
     && Time[0]                      == time_start
    )
     {
      int handle = FileOpen("Optimization .csv",FILE_WRITE|FILE_READ|FILE_CSV);
      FileSeek(handle, 0, SEEK_END);
      FileWrite(handle,"New pass");
      FileClose(handle);       
     }      
 
  if(   IsOptimization() == true
     && AccountBalance() != AccountBalance_old
    )
     {
       AccountBalance_old = AccountBalance();
       handle = FileOpen("Optimization .csv",FILE_WRITE|FILE_READ|FILE_CSV);
       FileSeek(handle, 0, SEEK_END);
       FileWrite(handle,AccountBalance());
       FileClose(handle);
     }
}
Now every new pass "New pass" is inserted as a title for the next balance row. Not what I really wanted but it makes able that a makro in excel can seperate between different backtesting passes.
whroeder1
13596
whroeder1 2014.09.01 12:04  

See my multipass code mt4 strategy tester - BATCH MODE - MQL4 forum It needs to be updated for 600+ (dots in var names and OutputDebugStringA)

APeng
359
APeng 2014.09.07 15:35  
WHRoeder:

See my multipass code mt4 strategy tester - BATCH MODE - MQL4 forum It needs to be updated for 600+ (dots in var names and OutputDebugStringA)




thanks!
/
To add comments, please log in or register