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
I've just realised it is actually the experts log that I need to read in values/text from, and not the journal - I had some manual alerts set up in my terminal along with an indicator so I got the two mixed up.
And yes after some further digging I've found many say the logs are not flushed in real time. The only way to force an update is to right click the logs in the terminal and click open , and it then updates. Someone here has written some code to force the terminal to do this process on every new bar - https://www.mql5.com/en/forum/131720 - I've not tested this out yet though. This isn't really an ideal solution as I imagine opening closing the log file repeatedly is going to be resource intensive. I would want to be doing this more than every bar, probably once every few ticks!
However this is the closest I've found to a solution so far so might have to work with it and try it out.
What are the "winapi functions"?
I've just realised it is actually the experts log that I need to read in values/text from, and not the journal - I had some manual alerts set up in my terminal along with an indicator so I got the two mixed up.
And yes after some further digging I've found many say the logs are not flushed in real time. The only way to force an update is to right click the logs in the terminal and click open , and it then updates. Someone here has written some code to force the terminal to do this process on every new bar - https://www.mql5.com/en/forum/131720 - I've not tested this out yet though. This isn't really an ideal solution as I imagine opening closing the log file repeatedly is going to be resource intensive. I would want to be doing this more than every bar, probably once every few ticks!
However this is the closest I've found to a solution so far so might have to work with it and try it out.
What are the "winapi functions"?
That's why I asked why you want to read the Journal log ;-)
WinApi is API from Microsoft which is the base of Windows, you can use these functions as a workaround for MT4 limitations, but it's most of the time useless now, with new MT4 build.
For your problem it could be a solution, but in my opinion it's better to proceed otherwise to control your self what is written in the Expert logs, code your own alerts, don't use MT4 built-in, same for indicators.
That's why I asked why you want to read the Journal log ;-)
WinApi is API from Microsoft which is the base of Windows, you can use these functions as a workaround for MT4 limitations, but it's most of the time useless now, with new MT4 build.
For your problem it could be a solution, but in my opinion it's better to proceed otherwise to control your self what is written in the Expert logs, code your own alerts, don't use MT4 built-in, same for indicators.
Thanks, I'll do some research into the WinApi.
I've read through the File Operations section in the MQL4 book today and managed to write a basic function to read in the information that I need from the log file if it was stored in the MQL4/Files folder...
However my question now is how do I get it to search for the file in the MQL4/Logs folder instead?
I'm guessing this is where the WinApi comes in... I'll have a look into it...
I've moved a stage further with this now. I used the information in this article - https://www.mql5.com/en/articles/1540 - to help me write some code to read the log file using functions from the "kernel32.dll".
I'm having a problem with it though. It's giving me an error when it tries to open the file at the first "_lopen" command. Can anyone see where this might be going wrong?...
Got this working now :)
The _lopen command doesn't work in the latest builds of MT4.
Here someone has written a ReadFile function that uses the latest commands - https://www.mql5.com/en/forum/147939 - I've modified this to do what I need.
Now I just need to find an efficient way to have the log files refresh in real time!
Can someone tell me one reason to read the Journal log from an EA ? Thanks.
I want to do this so that I can get the ms that a BUYSTOP order was executed
I want to do this so that I can get the ms that a BUYSTOP order was executed
I want to do this so that I can get the ms that a BUYSTOP order was executed
Hi Trevor, i came across your EA banana pip 1.25, can you share with me its source codes? i want to improve it, thanks
Can someone tell me one reason to read the Journal log from an EA ? Thanks.
My VPS-Provider restarts my Expert every view Days and all local and global Data/Files will be deleted. Same effect appears when re-uploading the Expert to the VPS. The Server-Log seems to to be the only persistent channel. Is there a better (working) way to preserve Data?