Hi,
How do I code my EA to read MT4 Journal Messages and compare the String Generated?
What is the code to detect if the order buy message in the MT4 journal contains the string “opening at 0.00000” or “failed” or “[Off quotes]”?
Hi,
How do I code my EA to read MT4 Journal Messages and compare the String Generated?
What is the code to detect if the order buy message in the MT4 journal contains the string “opening at 0.00000” or “failed” or “[Off quotes]”?
As far as Im aware you cant read the journal (well not using MQL anyway)
You’d handle this stuff from directly within the EA, the OrderSend function either returns the ticket number of the trade, or a -1 if it fails.
If the function returns a ticket number you can get details of time, price etc by first selecting the order using the OrderSelect function, then calling whichever function you might want such as open price, comment, mgic number etc etc.
If the function returns a -1, use the GetLastError function to determine the specific error message that was raised.
Hi,
I suspect my EA still thinks it has opened an order when it gets the Off quotes error. Because the journal says buy Order opened at 0.00000 failed [off Quotes].
How can I handle this kind of error?
How can I code the EA to check the open order price?