Write to file on bar close with MT4 backtester New comment Stephane Metz 2013.04.20 20:14 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; } Experts: MacdPatternTraderv01. +300 points monthly Will create your Expert Advisor for Free! export a .csv file with an expert advisor Simon Gniadkowski 2013.04.20 20:18 #1 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. Stephane Metz 2013.04.20 20:34 #2 RaptorUK: Use the search to look for once per bar. Thanks i found what i was searching for. New comment
Hi,
how could i write in a file on closing of actual bar cause my code writes to often to the file :