Download MetaTrader 5
To add comments, please log in or register
You can test an application before buying it. Find out how to do that!
Gregory
71
Gregory 2014.08.14 19:27 

When buying/selling, i always add a "print" message to explain which open/close method was used. It is displayed in the "Experts" tab, but not in the txt log file that has a date as name.

If that is intented, it would be NICE to have print message added to log file!

THanks :) 

qjol
3243
qjol 2014.08.14 19:41  

right click on one of the lines in Experts ---> Open and you will see it

or restart the terminal and you are gonna find it in the file

Gregory
71
Gregory 2014.08.14 19:46  

Thanks a million Qjol !

Indeed !!! I was looking in the log folder when you do File\Open Data Folder, and there in the log file you dont have the "print" messages.... Not sure why they are two log files not with the same format !

Have a nice weekend 

Hongliang Liu
1196
Hongliang Liu 2014.08.18 01:40  

this is my function to save to my own log file,the same parameter with print function

//+------------------------------------------------------------------+
//| Write usefull log to file                                        |
//+------------------------------------------------------------------+
void WriteToLogFile(string logstring)
{
    int handle;
    string filedatestr = "" + (string)TimeYear(TimeCurrent()) + "_" + (string)TimeMonth(TimeCurrent()) + "_" + (string)TimeDay(TimeCurrent()) + "";
    handle = FileOpen("mylog_" + filedatestr + ".txt", FILE_READ|FILE_WRITE);
    string baseinfo = TimeToStr(TimeCurrent(),TIME_DATE|TIME_SECONDS);
    baseinfo = baseinfo + " Balance:" + (string)AccountBalance() + " Equity:" + (string)AccountEquity() + "\nMargin:" + (string)AccountMargin() + " FreeMargin:" + (string)AccountFreeMargin() + "\n";
    if(handle > 0)
    {
        FileSeek(handle, 0, SEEK_END);
        FileWrite(handle,baseinfo,logstring);
        FileClose(handle);
    }
}

 FYI

/
To add comments, please log in or register