EA Won't Trade on a VPS: Fix AutoTrading and Live Trading

Your EA is attached but places no orders. Check the toolbar AutoTrading switch, the EA's Allow live trading box, the Options settings that switch trading off, and the logs.

dns WindowsVPS Team calendar_today schedule5 min read
EA Won't Trade on a VPS: Fix AutoTrading and Live Trading
tocOn this page 9 sections
  1. Step 1: Read the chart before changing anything
  2. Step 2: Turn on AutoTrading for the whole terminal
  3. Step 3: Tick Allow live trading on the EA itself
  4. Step 4: Stop the terminal from switching trading off
  5. Step 5: Check the login and the broker side
  6. Step 6: Unblock downloaded EA files and DLLs
  7. Step 7: Search the logs from PowerShell
  8. Step 8: Make the fix survive restarts
  9. FAQ

An EA that is attached to a chart but never opens a trade is almost always blocked by one of three switches: the terminal-wide AutoTrading button (called Algo Trading in newer MT5 builds), the EA's own Allow live trading checkbox, or a terminal option that turned automated trading off after a login or profile change. Check all three in that order, then read the Experts and Journal logs for the exact error code. On a VPS, the usual extra causes are restarts that come back with trading disabled and downloaded DLLs that Windows has blocked.

Step 1: Read the chart before changing anything

Connect over RDP and look at the top-right corner of the chart that runs the EA.

  • MT4: a smiling face means the EA is allowed to trade. A frowning face means trading is blocked. If there is no face at all, the EA failed to load.
  • MT5: the EA name appears with an icon. A blue icon means trading is allowed. A grey icon means it is blocked.

Next, open the Experts and Journal tabs in the Toolbox (Ctrl+T). The message there tells you which of the steps below applies.

Step 2: Turn on AutoTrading for the whole terminal

The AutoTrading / Algo Trading button on the main toolbar is a master switch. When it is off, no EA can trade, whatever its own settings say. Click it so it shows green, or press Ctrl+E. While it is off, MT4 EAs log error 4109 (trade not allowed) and MT5 order requests fail with retcode 10027 (autotrading disabled by client terminal).

Step 3: Tick Allow live trading on the EA itself

Press F7 on the chart, or right-click and choose Expert Advisors > Properties. Open the Common tab and tick Allow live trading (MT5: Allow Algo Trading). If the EA calls an external library, also tick Allow DLL imports. Click OK. The face should turn to a smile, or the icon should turn blue.

To make this the default for every EA you attach later, set it once under Tools > Options > Expert Advisors.

Step 4: Stop the terminal from switching trading off

In Tools > Options > Expert Advisors, look at the boxes that disable automated trading when something changes:

  • Disable automated trading when the account has been changed
  • Disable automated trading when the profile has been changed
  • Disable automated trading when the chart symbol or period has been changed (MT4)

A brief disconnect followed by an automatic re-login can count as an account change. That turns AutoTrading off and leaves it off until someone clicks the button. If the Journal shows a line saying automated trading was disabled because the account or profile changed, untick the matching box. Only do this if you run a single account in that terminal.

Step 5: Check the login and the broker side

  • Investor password: if you logged in with the read-only investor password, every order fails. MT4 logs error 133 (trade is disabled) and MT5 logs retcode 10017. Log in again under File > Login to Trade Account with the master password.
  • Server-side block: MT5 retcode 10026 means the broker has disabled automated trading on the account. Only the broker can lift it.
  • Symbol and session: a market that is closed (retcode 10018) or a symbol set to close-only rejects orders even when every switch is on. Check the trading hours under Market Watch > Specification. Also confirm the EA is attached to the right symbol suffix, for example EURUSD.r rather than EURUSD.

Step 6: Unblock downloaded EA files and DLLs

EA files and DLLs that you downloaded through a browser on the VPS carry a Windows Zone.Identifier mark. A blocked DLL can fail to load, and the Experts tab shows a DLL loading error instead of a trade. Clear the mark in PowerShell:

Get-ChildItem "$env:APPDATA\MetaQuotes\Terminal" -Recurse -Include *.dll,*.ex4,*.ex5 |
  Unblock-File

If you run the terminal with /portable, point the path at the install folder instead. Restart the terminal afterwards so the files load cleanly.

Step 7: Search the logs from PowerShell

If the EA fails only overnight, search the saved logs rather than relying on what is on screen. To find the folder, use File > Open Data Folder. The Experts log is in MQL4\Logs or MQL5\Logs, and the Journal is in logs.

Get-ChildItem "$env:APPDATA\MetaQuotes\Terminal\*\MQL5\Logs\*.log" |
  Select-String -Pattern '10027|10026|10017|4109|133|disabled' |
  Select-Object -Last 30

Match each timestamp against Get-WinEvent -FilterHashtable @{LogName='System'; Id=1074}. Event 1074 records a planned restart, which shows whether a Windows Update reboot came just before trading stopped.

Step 8: Make the fix survive restarts

If you start MT5 with a config file (terminal64.exe /config:start.ini), set trading explicitly so a reboot can't come back with it off:

[Experts]
Enabled=1
AllowLiveTrading=1
AllowDllImport=1
Account=0
Profile=0

Account=0 and Profile=0 stop the terminal from disabling trading on an account or profile change. Before you close the terminal, save the chart setup with File > Profiles > Save As so the EA is reattached on the next start. Our guide to auto-restarting MT4 and MT5 after Windows Update reboots covers the startup task. The MT4 install and configuration walkthrough covers the base terminal settings. For hosting options sized for terminals, see our Windows VPS for Forex trading page.

FAQ

Does disconnecting from RDP stop my EA?

No. Closing the RDP window disconnects the session but leaves it running, so the terminal keeps trading. Signing out with Start > Sign out closes the terminal and stops the EA.

The face is smiling but there are still no trades. Why?

Every switch is on, so the EA's own logic is choosing not to trade. Check its inputs for time filters, spread limits, maximum lot settings or a built-in trade on/off input, and read the Experts tab for messages the EA prints.

Why did AutoTrading turn off overnight by itself?

Usually a reconnect counted as an account change, or the VPS rebooted and the terminal restarted with trading disabled. Fix the Options checkboxes from Step 4 and use a startup config like the one in Step 8.

Run this on your own Windows VPS

Get a Windows VPS from WindowsVPS in about 60 seconds, with full Administrator access over RDP, NVMe storage and the Windows license included.

Buy a Windows VPS →

dns

Written by the WindowsVPS Team

We run Windows Server VPS hosting and write these guides from the same setups our customers use: RDP, PowerShell, trading terminals and always-on bots. Questions about a guide? Contact us.

About WindowsVPS Windows VPS guides All articles

Ready to deploy your server?

Windows or Linux VPS — up and running in under 60 seconds.