Download MetaTrader 5

Simple program write to file - page 2

To add comments, please log in or register
MetaQuotes Software Corp.
Moderator
188964
MetaQuotes Software Corp.  
edas:

Here is line from expert:

But expert writes line by line from beginning of existing file. Perhaps it is necessary to tell expert to write to end of file with cycle statement, but I don't understand how write such cycle.

Edward

To add data to the end of CSV file use FileSeek.

fx-analysis
194
fx-analysis  
Thanks Quantum, it helped :)
meikel
364
meikel  
int FileHandle=FileOpen(FileName, FILE_BIN|FILE_WRITE|FILE_READ);
  if(FileHandle>0)
     {
      FileSeek(FileHandle, 0, SEEK_END);
      FileWrite(FileHandle,Text) ;
      FileClose(FileHandle);
     }
sunyc1982
9
sunyc1982  
MetaQuotes:


File handle is not boolean, here is your code that saves Time, Bid, Ask.


Enable experts, and attach it to chart. after the expert deataching your file data1.csv will have contents something like this:

Can you make your ea only record the last 50 ticks?
Simon Gniadkowski
Moderator
18040
Simon Gniadkowski  
sunyc1982:

Can you make your ea only record the last 50 ticks?
Why are you asking a question about a 4 year old post ?
12
To add comments, please log in or register