|
MT4 file functions
hello, my Indicator uses the following code to record every trade signal to a text file. by default, the latest signal is the last record at the bottom of the file. what I want to do is to reverse this order. that is, I'd like my latest signal to come on top. does anybody know how to do this?
void Trade_Log(string type,string price,string sigBar)
{
//----
int handle = 0;
string log = "";
//----
log = type+"@"+price+" @ "+sigBar+" bars";
handle = FileOpen("lastSignal_.dat",FILE_BIN|FILE_READ|FILE _WRITE);
if(handle>0){ FileSeek(handle,0,SEEK_END);
FileWrite(handle,log);
FileClose(handle);
handle = 0;
}
//----
}
|