Write to file on bar close with MT4 backtester

 

Hi,

how could i write in a file on closing of actual bar cause my code writes to often to the file :

   int handle=0;
   datetime date = TimeCurrent();
   string Date = TimeToStr(date, TIME_DATE|TIME_MINUTES);
   handle=FileOpen("tma.csv",FILE_CSV|FILE_READ|FILE_WRITE,';');
   if(handle>0)
   {
      FileSeek(handle, 0, SEEK_END);
      FileWrite(handle, Date, NormalizeDouble(tma_up,precision), NormalizeDouble(tma_low, precision));
      FileClose(handle);
      handle = 0;
   }
 
condor666:

Hi,

how could i write in a file on closing of actual bar cause my code writes to often to the file :

Use the search to look for once per bar.
 
RaptorUK:
Use the search to look for once per bar.


Thanks i found what i was searching for.