Simple program write to file - page 2

 
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.

 
Thanks Quantum, it helped :)
 
int FileHandle=FileOpen(FileName, FILE_BIN|FILE_WRITE|FILE_READ);
  if(FileHandle>0)
     {
      FileSeek(FileHandle, 0, SEEK_END);
      FileWrite(FileHandle,Text) ;
      FileClose(FileHandle);
     }
 
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?
 
sunyc1982:

Can you make your ea only record the last 50 ticks?
Why are you asking a question about a 4 year old post ?