Why your MT4/MT5 expert advisor stopped trading on a VPS, and how to catch it early

Your expert advisor ran fine on the home PC. You moved it to a VPS to keep it online around the clock, and now the account has sat flat for two days while the signals kept firing. Nothing crashed. The terminal is open, the chart is live, the EA is attached. It just stopped placing orders.
The cause is almost always on a short list, and the terminal already named it for you. It is written in the Journal or the Experts tab. Here is how to read those two tabs, and the causes in the order they go wrong on a freshly migrated VPS.
Read the two log tabs before you change anything
Open the Toolbox (Ctrl+T). Two tabs matter.
- Journal records platform events: terminal start, login success or failure, connection to the trade server, and reboots. If the terminal lost its account or its connection, it shows here.
- Experts records what the EA did: its
init()run, everyOrderSend()call, the server's reply code, and anything your code writes withPrint(). If the EA tried to trade and the broker refused, the reason is here.
Both write to disk as well. On MT5 look in MQL5\Logs\; on MT4 in the logs\ folder under the terminal's data directory. Right-click a tab and choose Open to reach the files. Sort by time and read forward from the last restart. The first error after startup is usually the whole story.
The usual suspects, most common first
1. AutoTrading switched off after a restart
The AutoTrading button sits in the top toolbar. Green means the terminal will let EAs trade. Grey or red means it will not, for every chart at once. A terminal restart can bring it back disabled, and a restart is exactly what a VPS does for you. The chart's top-right corner confirms the state: a smiley face means the EA is allowed to trade, a sad face means it is blocked. In the MT5 Experts log this appears as retcode 10027, TRADE_RETCODE_CLIENT_DISABLES_AT, "Autotrading disabled by client terminal". Click the button so it goes green. This is the single most common reason an EA goes quiet on a VPS.
2. "Allow Algo Trading" unticked in the EA's own properties
There are two switches here, and both must be on. The toolbar button is global. Each chart's EA also carries its own permission, in its properties window on the Common tab, labelled Allow Algo Trading (Allow live trading on MT4). Attach the EA, click through that dialog with the box unticked, and the EA loads, runs its logic, prints to the log, and never sends an order. There is a third, master checkbox under Tools, Options, Expert Advisors. If the toolbar is green but nothing trades, check both of the per-chart and master boxes.
3. Logged out after a server change or password reset
Reset the account password, or let the broker rename or migrate its trade server, and the credentials saved on the VPS are now stale. The Journal shows a login attempt that fails, or a connection that never completes. The EA cannot trade because the terminal is no longer on the account. Re-enter the login, the current password and the exact server name from the broker. Server names change more often than people expect, usually after a broker merges entities or splits its demo and live groups.
4. The VPS rebooted for Windows Update and nobody logged back in
This is the VPS-specific trap, and it is the one people lose days to. A standard MetaTrader terminal runs inside an interactive desktop session. Windows Server does not restore that session on its own after a reboot. Microsoft's Winlogon Automatic Restart Sign-On (ARSO), the feature that signs the last user back in after an update restart, is disabled by default on server editions. So the VPS patches overnight, reboots, sits at the lock screen, and your terminal is simply not running. The account looks untouched because nothing is touching it. Compare the Journal's last entry time with the system's last boot time. A gap between them means the terminal was down.
5. Wrong symbol suffix
Brokers rarely name the instrument plain EURUSD. You will see EURUSD.m, EURUSD_ecn, EURUSDpro, or a dotted suffix that differs between the demo you built on and the live account you moved to. An EA with the symbol hardcoded, or one reading the wrong Market Watch row, looks up an instrument that does not exist on this account and quietly does nothing. The Experts log shows the symbol string it is trying to use. Compare that string character for character against Market Watch. This catches almost everyone who migrates from one broker's demo to another broker's live account.
6. Market closed or trade disabled
These two read alike and mean very different things. Market is closed (MT5 retcode 10018, MT4 error 132) is about time: the weekend, a session gap, or an instrument that trades limited hours. Wait for the session to open. Trade is disabled (MT5 retcode 10017, MT4 error 133) is about permission: the account or symbol is set to close-only, the account is not fully activated, there is a compliance hold, or you signed in with the read-only investor password. The investor-password case is the sneaky one. Login succeeds, the chart ticks, and every order fails. If every trade returns trade-disabled from the first tick, suspect the password first.
7. Not enough free margin
If the lot size needs more margin than the account has free, the order is rejected with MT5 retcode 10019, TRADE_RETCODE_NO_MONEY, "There is not enough money to complete the request". A fixed-lot EA sized for a larger balance, or an account already drawn down by open positions, hits this. Smaller lots or more free margin is the only fix. The platform is doing its job here, not failing.
Log code to cause, at a glance
| What the log says | MT5 retcode | MT4 error | What it means | First move |
|---|---|---|---|---|
| Autotrading disabled by client terminal | 10027 | n/a | Global/per-chart AutoTrading off | Turn AutoTrading green, tick the EA boxes |
| Trade is disabled | 10017 | 133 | Account/symbol permission, or investor password | Check the password, then the broker |
| Market is closed | 10018 | 132 | Session or time window | Wait for the session |
| No connection with the trade server | 10031 | 6 | Disconnected or wrong server name | Re-login, refresh the server list |
| Not enough money | 10019 | n/a | Free margin too low for the volume | Reduce lot size |
| Invalid price | 10015 | 129 | Requote or stale price | Widen deviation/slippage |
| Invalid stops | 10016 | 130 | SL/TP too close or on the wrong side | Fix the stop levels |
| Invalid volume | 10014 | n/a | Lot step, min or max breached | Match the broker's volume rules |
| Trade context is busy | n/a | 146 | Too many EAs in one terminal | Split them across terminals |
| Request completed | 10009 | n/a | Success | Nothing, this one is good |
MT4 and MT5 report the same situations through different numbering. MT4 raises classic error codes like 133 and 132; MT5 returns the TRADE_RETCODE_* values in the retcode field of the trade result. Where a cell reads n/a above, that platform surfaces the condition through a message rather than a code you will match one-to-one.
Tell the look-alikes apart
- 10027 vs 10017. 10027 is your side: AutoTrading is off in the terminal. 10017 is the broker's side: trading is blocked on the account or symbol. Clicking buttons fixes the first and does nothing for the second.
- Market closed vs trade disabled. If it clears when the session opens, it was 10018/132. If it persists into a live session, it is 10017/133.
- No connection vs logged out. No connection (10031/6) is a network or server-name problem and often recovers on its own. A failed login in the Journal means the credentials are wrong and it will never recover until you fix them.
- The investor-password tell. Everything looks healthy, quotes update, yet every order dies with trade-disabled. That pattern points at a read-only password far more often than at the broker.
Stop it happening again
Three changes remove most of this before it starts.
- Log in automatically after a reboot. On Windows Server, enable autologon (run
netplwizand untick "Users must enter a user name and password"), or enable ARSO through Group Policy so the last session returns after an update restart. Set the terminal to launch on login and auto-attach the EA. - Control when updates reboot. Set active hours or a maintenance window so Windows does not restart in the middle of the trading week, and set supporting services to Automatic (Delayed Start) so they come back cleanly. Patch on the weekend, on purpose.
- Get told when it disconnects. Do not find out two days late. Fire an alert when the terminal drops its connection, through a small EA that checks on
OnTimer(), the platform's built-in push notifications, or an external uptime check against the session. A managed service that re-logs in and reattaches each EA after a reboot removes the fourth cause entirely. Our MetaTrader VPS starts each terminal, signs it back into its account and reattaches its expert advisor after a restart, so a Windows Update reboot does not leave the account sitting flat.
When you cannot fix it from your side
Some of these are not yours to fix, and knowing when to stop saves hours. If every order returns trade-disabled (10017 / 133) and the password is correct, the block is on the broker's trade server: a close-only symbol, an account under a compliance hold, or a live account not fully activated. No amount of clicking AutoTrading changes that. Stop troubleshooting the terminal and open a ticket with the broker. The same goes for a symbol the broker has pulled from your account group. The terminal is reporting the truth; the switch is on their side.
Where to run this
Put the terminal in the region closest to your broker's trade server, then keep it online. Karizanta runs MetaTrader VPS on Windows Server templates, deployed in under 60 seconds, with on-demand snapshots so you can roll back a bad platform update and 24/7 support if a terminal will not come back. We sell in three places: UK VPS in Coventry, Sweden VPS in Stockholm, and Netherlands VPS in Naaldwijk. We will not quote you a ping figure to your broker, because it depends on which data centre the broker uses. Measure it yourself from the VPS with the account logged in, then pick the region that comes back lowest.
Sources
- Trade Server Return Codes - MQL5 Reference
- The most common errors in MetaTrader 4 and how to solve them - StrategyQuant
- Winlogon automatic restart sign-on (ARSO) - Microsoft Learn
- 'Trade is disabled' in MetaTrader: why you can't place orders
- MT5 troubleshooting guide - OANDA
Frequently asked questions
My MT5 Experts log shows retcode 10027. What does that mean?
AutoTrading is switched off in the terminal. 10027 is TRADE_RETCODE_CLIENT_DISABLES_AT, "Autotrading disabled by client terminal". Click the AutoTrading button in the toolbar so it turns green, and confirm the Allow Algo Trading box is ticked in the EA's own properties. It is a client-side block, not a broker one.
My EA worked on my home PC but not on the VPS. Why?
Most often the AutoTrading button came back off when the VPS restarted, or the VPS rebooted for Windows Update and nobody logged back in, so the terminal never started. Check the Journal's last entry time against the last boot time, and check the AutoTrading button is green.
Why does every order fail with "trade is disabled"?
Trade-disabled (MT5 10017, MT4 133) is a permission block, not a client setting. The usual cause is logging in with the read-only investor password. If the password is correct, the symbol or account is restricted by the broker (close-only, compliance hold, or not activated), and only the broker can lift it.
How do I stop the EA dying after a Windows Update reboot?
Enable automatic login on the VPS (netplwiz or ARSO via Group Policy), set the terminal to launch and auto-attach the EA on login, schedule updates to a weekend maintenance window, and add a disconnect alert. A managed MetaTrader VPS that re-logs in and reattaches the EA after a reboot handles this for you.
Does the symbol suffix really matter for an EA?
Yes. If the broker names the instrument EURUSD.m or EURUSD_ecn and your EA has EURUSD hardcoded, it looks up a symbol that does not exist on the account and never trades. Check the Experts log for the symbol string it uses and compare it character for character with Market Watch.



