To discover, find and resolve as well as preventing an ‘error’ from occurring in MT4 on a VPS, we have to check on several important things which are as follows (as forensic data/facts that come the closest to the events/reality in the particular Metatrader 4):
Within the meta trader folder (C:\Program Files\Metatrader 4\logs – could vary on each broker) and also on the bottom side of our meta trader, there are several tabs, including: the Journal Tab and the Expert Tab.
The Journal Tab, contains all executions which occurred between our VPS and the broker’s server.
While the Expert Tab, contains all executions which have been done by our EA, prior being treated as executed orders to the broker.
There are several Error Messages on MT4 that must be recognize by Traders:- Trade Context Busy
The main culprit of this issue is down to the MT4 program trying to send more than one signal simultaneously to broker servers. This can be caused by multiple mouse clicks or a hyperactive EA. Until the first task has been processed, the second can’t be processed and The MT4 will displays the “Trade context is busy” message. Restarting MT4 will clear this. - Off Quotes
Any order that breaches this broker's trading limitation will be rejected by the broker's server, which can result in an ”Off quotes” message shown.
In other cases, “Off quotes” usually indicates a break in connectivity resulting in no current prices being available. - No Connection
“No connection” appears when you’re not able to establish a connection with the broker's server. - Invalid T/P or S/L
The “Invalid S/L or T/P” error message appears if the stop loss or take profit you’re trying to place is not within the correct parameters of the limit and stop levels for that particular instrument. - Old Version
- Trading Disable
The “Trading disabled” error indicates that no trading activity can take place on your account. - Market Closed
- Not Enough Money
- Requote
A requote occurs when you request to execute an order at a specific price that is no longer available. This can occur during fast-moving markets
Important things to be alert of:
- You are not opening a position manually, the EA is also not opening any position, but all of a sudden, there’s a filled order (whether directly or a pending order).
- EA’s order is at 1.4000, the chart notifies (shows) that the targeted price has been reached, but the order is not executed.
- EA’s TP is at 1.4000, the chart notifies (shows) that the targeted price has been reached, but TP has not been executed.
- EA’s SL is at 1.4000, the chart notifies (shows) that the targeted price has not been reached, but SL has been executed.
- I am manually opening a position in my desktop computer, but the EA in the VPS is not handling my particular order.
- I am migrating the VPS, from an old one to a new VPS provider while there is a floating order. But when I opened the MT4 on the new VPS, all orders are immediately closed.
- I am migrating the VPS, from an old one to a new VPS provider while there is a floating order. But when I opened the MT4 on the new VPS, the EA on the new VPS was indicating that it is not handling the particular order.
Several Observation Guidance:
- Take note at the time (hour, minute, and second) when the EA are executing orders on the Expert Tab.
- Take note at the time (hour, minute, and second) when the executed orders are being forwarded to the server’s broker, on the Journal Tab.
- Compare both of the time, and find out whether they have any minor time differences (in seconds, usually, around 3 – 5 seconds).
- Is there any executed orders (open or close or pending orders), but not being logged in the Journal Tab?
- Is there any executed orders (in the Journal Tab), that does not exist in the Expert Tab?
- Is there any orders being done by the EA, but not executed (doesn’t exist in the Journal Tab).
The Trader’s Enemy (VPS users):
There are several error commands that appears in the log (or in the Journal Tab) of MT4, and some are interpreted as follows:
- Requote. This is the most frequent thing that happened and almost every trader has experienced it. Our MT4 is actually connected to 2 (two) sets of broker’s servers: firstly, the login and current prices server, and secondly, the charts building data server. Requote will occur when both data is not equivalent (same/similar/within the same limit). As the broker’s server owns the ‘tick history’ data (the bid and ask prices data – with the spread of a second), why did sometimes, instead of the TP targeted price, the SL targeted price was being the one that has been reached, whereas the chart did not show such thing. In fact, not all brokers are willingly to reveal this ‘tick history’ data, and nobody would ever know. Requote has nothing to do with the internet connection, would you believe it?
- Trade Context Busy. This might be happening due to the EA being too aggressive, or at one time, the EA failed to execute an order, and ‘force’ to do it continuously. So that, as the first execution has not been completely finished yet, the next one has already been done. To avoid this thing, is by frequently restarting your Metatrader.
- Trade Timeout. This could occur in a condition of the VPS connection to the broker’s server is disconnected (or unlink) within seconds. This is caused by many things, and the most probable is due to a network problem between the VPS and the broker’s server (there are several hops between the VPS and the broker’s server, and one of them might experiencing a slowdown/lag). The solution: restarting the Metatrader and/or the VPS.
- Trade Disable or Common Error. This also happens and is possible due to the broker’s server is being turned off, so it isn’t available. If restarting the MT4 has been done and this command still appears, try to use / connect using another broker’s server IP address. On Saturdays and Sundays (off trading), the broker’s server is frequently being turned off (due to several reasons, especially for maintenance).
- All of the list of error messages in MT4 can be viewed at this link https://docs.mql4.com/constants/errorswarnings/enum_trade_return_codes
- Please also refer to: Tips and Tricks for MT4 Users on a VPS.