Simo Dodero: Hello, (first at all sorry for my not so correct English)
Read the following thread: https://www.mql5.com/en/forum/99755
I'm using th function FileOpen and FileWrite like this codes:
Later if there are some condition I use this following code:
But my problem is that every time I use this function (code) it create a new file and replace it. All this code is inside void OnTick { } in my EA.
I'd like to write data row after row in CSV file when I write on it. (this is because i wrote "\t\r" )
Any idea? Thank You !!

How to keep previous data when open write and close?
- www.mql5.com
Hi, I want to write an script which I should use file commands to store some data like names of stocks in it, but it will be overwritten everytime...
Thank You, I will read it !!!

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
Hello, (first at all sorry for my not so correct English)
I'm using th function FileOpen and FileWrite like this codes:
if(filehandle!=INVALID_HANDLE)
{
FileWrite(filehandle,Symbol(),EnumToString(ENUM_TIMEFRAMES(_Period)),"startcycle",startHour,DoubleToString(openprice,5) ); // I WRITE VARIABLES IN FILE CSV
FileClose(filehandle);
// Print("FileOpen OK");
}
Later if there are some condition I use this following code:
int filehandle=FileOpen("datosbloque2.csv",FILE_WRITE|FILE_CSV,"\t\r"); //FILE datosbloque2.CSV
if(filehandle!=INVALID_HANDLE)
{
FileWrite(filehandle,Symbol(),EnumToString(ENUM_TIMEFRAMES(_Period)),starthour,NormalizeDouble(open,5),NormalizeDouble(hhpoints,5),NormalizeDouble(hhporcentaje,4),"%",NormalizeDouble(llpoints,5),NormalizeDouble(llporcentaje,4),"%" );
FileClose(filehandle);
}
else Print("Operation FileOpen failed, error ",GetLastError());
But my problem is that every time I use this function (code) it create a new file and replace it. All this code is inside void OnTick { } in my EA.
I'd like to write data row after row in CSV file when I write on it. (this is because i wrote "\t\r" )
Any idea? Thank You !!