Download MetaTrader 5

Any way to get PRINT messages saved into logfile?

To add comments, please log in or register
Have you developed a profitable strategy? Launch your trading signal and make profit from it!
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 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 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
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);


To add comments, please log in or register