https://docs.mql4.com/files/FileOpen
Maybe you need changed:
int Handle=FileOpen(filename,FILE_CSV | FILE_READ | FILE_WRITE,';'); if(Handle>0) FileSeek(handle, 0, SEEK_END);
Thanks dude for your help. :)
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
Hi there,
I am trying to open a csv file and add some information to the end of it.
I use for example:
string filename="test.csv";
int Handle=FileOpen(filename,FILE_CSV|FILE_WRITE,';');
to open a csv file and:
string date=TimeToStr(TimeLocal(),TIME_DATE);
string time=TimeToStr(TimeLocal(),TIME_SECONDS);
int write_handle=FileWrite(Handle,date,time,"EA ATTACHED TO CHART");
to write local time and date to it and at the end:
FileClose( Handle );
to close my file.
MY PROBLEM IS THAT WHENEVER EA OPENS THE FILE IT'S FILE HANDLE WILL RESET TO THE START OF FILE AND WHATEVER I WRITE BASICALLY OVER-WRITES THE FILE.
SO HOW CAN I SHIFT THE HANDLER TO THE END OF FILE SO IT WOULD APPEND THE NEW DATA TO THE EXISTING FILE?
thank you for your help.