AutoTrading Disabled in MT5: Fix Retcodes 10027 & 10026 (EA Not Trading)
Contents
- 10027 vs 10026: who is blocking you?
- ① TRADE_RETCODE_CLIENT_DISABLES_AT = 10027 (YOUR terminal says no)
- ② TRADE_RETCODE_SERVER_DISABLES_AT = 10026 (the BROKER says no)
- MT5's 4-layer permission model — ALL must be on
- Layer 1: the toolbar "Algo Trading" button (terminal-wide)
- Layer 2: Tools → Options → Expert Advisors → "Allow algorithmic trading"
- Layer 3: the per-chart EA setting — Common tab → "Allow Algo Trading"
- Layer 4: the EA icon in the chart's top-right corner
- 30-second triage (in this order)
- Five causes everyone misses
- ① Logged in with the investor (read-only) password
- ② The broker forbids EAs on this account type (10026)
- ③ Terminal updates, restarts, and account switches reset the button
- ④ VPS auto-start launches MT5 with AutoTrading off
- ⑤ Demo vs real account mix-up
- Detecting the state from MQL5 (for EA developers)
- How to wire it in
- Priority checklist
- Summary
- FAQ
- Q: I turned the Algo Trading button on, but the EA still won't trade.
- Q: What's the difference between 10027 and 10026?
- Q: AutoTrading keeps switching itself off.
- Q: Manual orders work, only the EA can't trade.
AutoTrading Disabled in MT5 (10027 / 10026)
You attach an EA to a chart, wait hours — and nothing happens. No trades, no error popup, just silence. The number-one cause of an EA that refuses to trade is disabled AutoTrading (Algo Trading), and it's sneaky precisely because it fails quietly. Worse, MT5's trading permission is a four-layer stack: if any single layer is off, no order goes out.
This guide covers both sides — MT5 users running EAs and MQL5 developers writing them: what the two return codes 10027 (TRADE_RETCODE_CLIENT_DISABLES_AT) and 10026 (TRADE_RETCODE_SERVER_DISABLES_AT) mean, the four permission layers, the causes everyone misses, and the code that makes an EA report which layer is blocking it. For the full list of error codes, see the complete MT5 error-code guide.
This article targets MT5 (build 4xxx) as of July 2026. Panel names and icon styling vary slightly by build.
10027 vs 10026: who is blocking you?
Two return codes say "autotrading disabled" — the difference is which side turned it off. Telling them apart decides half the fix.
① TRADE_RETCODE_CLIENT_DISABLES_AT = 10027 (YOUR terminal says no)
AutoTrading is disabled on the client side — your own MT5 terminal. The toolbar Algo Trading button is off, or the permission in Options is unchecked. The order request is rejected inside the terminal before it ever reaches the broker's server.
Meaning : AutoTrading disabled by client terminal
Constant: TRADE_RETCODE_CLIENT_DISABLES_AT
Value : 10027
Typical lines in the Experts tab:
2026.07.07 09:15:32.441 EA_NAME (XAUUSD,H1) OrderSend failed 10027
2026.07.07 09:15:32.441 EA_NAME (XAUUSD,H1) CTrade::OrderSend: ... [autotrading disabled by client]
The fix is entirely on your machine — switch on all four layers described in the next section.
② TRADE_RETCODE_SERVER_DISABLES_AT = 10026 (the BROKER says no)
The server — your broker — has disabled autotrading for this account. No amount of clicking on your terminal fixes this. It happens on account types whose terms forbid EAs (some cent, bonus, or contest accounts) or when the broker has switched off algo trading for the account.
Meaning : AutoTrading disabled by server
Constant: TRADE_RETCODE_SERVER_DISABLES_AT
Value : 10026
The only fix is contacting the broker: ask whether this account type allows EAs, and whether you need to switch or open an EA-enabled account.
| Code | Constant | Who blocks | Fix |
|---|---|---|---|
| 10027 | TRADE_RETCODE_CLIENT_DISABLES_AT | your MT5 terminal | enable the 4 layers (this article) |
| 10026 | TRADE_RETCODE_SERVER_DISABLES_AT | broker's server | ask the broker about EA permission |
MT5's 4-layer permission model — ALL must be on
Between your EA and a live order sit four independent switches. One off = no trades. When "it worked yesterday", one of these flipped.
Layer 1: the toolbar "Algo Trading" button (terminal-wide)
The big Algo Trading button in MT5's toolbar: green play mark (▶) when on, red stop mark when off. Keyboard shortcut: Ctrl+E — accidentally hitting it is a surprisingly common way to switch everything off. When this is off, every EA on every chart is blocked at once, producing 10027.
Layer 2: Tools → Options → Expert Advisors → "Allow algorithmic trading"
The master permission underneath the button. If this is unchecked, the toolbar button can't help you.
The same tab also has the "Disable algorithmic trading when..." checkboxes (switching accounts / switching profiles / changing the chart symbol or period). With these ticked, the toolbar button silently flips off the moment you switch accounts or profiles — the usual culprit behind "it randomly stops sometimes".
Layer 3: the per-chart EA setting — Common tab → "Allow Algo Trading"
In the dialog shown when you attach an EA (or right-click the EA name on the chart → Properties), the Common tab has its own "Allow Algo Trading" checkbox. This one applies to this EA on this chart only. If it's unchecked, other EAs trade fine while this one stays mute — and MQLInfoInteger(MQL_TRADE_ALLOWED) returns false for it.
Layer 4: the EA icon in the chart's top-right corner
When an EA is loaded, MT5 shows the EA name with a small hat icon in the chart's top-right corner:
- Colored (blue) hat = the EA is running and allowed to trade
- Gray / struck-out hat = the EA is loaded but trading is blocked (one of layers 1–3 is off)
- No EA name at all = the EA isn't on the chart (failed to load or was removed)
The icon is a status display, not a switch — but it's the fastest single glance to confirm the whole stack. Exact styling varies by build.
| Layer | Where | Scope | MQL5 detection |
|---|---|---|---|
| ① Algo Trading button | toolbar (Ctrl+E) | whole terminal | TERMINAL_TRADE_ALLOWED |
| ② Options permission | Tools → Options → Expert Advisors | whole terminal | TERMINAL_TRADE_ALLOWED |
| ③ per-chart permission | EA Properties → Common tab | this EA only | MQL_TRADE_ALLOWED |
| ④ EA icon | chart top-right corner | status display | — (result of ①–③) |
30-second triage (in this order)
- Is the toolbar Algo Trading button green (▶)? → If red, click it (or Ctrl+E)
- Does the chart's top-right corner show the EA name with a colored hat? → Gray: continue; missing entirely: re-attach the EA
- EA Properties → Common tab → is "Allow Algo Trading" checked? → Tick it and press OK
- Tools → Options → Expert Advisors → is "Allow algorithmic trading" enabled? → Also review the "disable when switching..." checkboxes
- Check the login — are you on the investor (read-only) password? → Re-login with the trading password
- All of 1–5 fine but you get 10026? → Ask the broker whether this account allows EAs
Steps 1–3 resolve the vast majority of cases.
Five causes everyone misses
① Logged in with the investor (read-only) password
Every MT5 account has a trading password and an investor password (view-only). Under an investor login, no order — manual or automated — can be placed, regardless of the Algo Trading button. This bites after sharing view access with someone, or when a password manager autofills the wrong one. In MQL5, AccountInfoInteger(ACCOUNT_TRADE_ALLOWED) returns false in this state, which makes it easy to detect. Re-login with the trading password.
② The broker forbids EAs on this account type (10026)
Some cent, bonus-linked, and contest accounts prohibit EA trading in their terms. The server rejects with 10026, and nothing on your terminal can override it. Check the account terms, and move to an EA-enabled account type if needed.
③ Terminal updates, restarts, and account switches reset the button
After an MT5 update, or with the Options checkboxes "disable algorithmic trading when switching accounts/profiles" active, the Algo Trading button can come back off. This is the classic "it traded all last week, then quietly stopped" pattern. Make checking the button color part of every restart, or untick the auto-disable options.
④ VPS auto-start launches MT5 with AutoTrading off
On a VPS, people automate "Windows reboots → MT5 relaunches" and stop there — but the relaunched terminal may come up with algo trading disabled. MT5 supports passing a configuration (ini) file at startup via /config, whose [Experts] section can grant live-trading permission (AllowLiveTrading) and even auto-attach an EA. If you automate startup, automate this part too — and always verify remotely that the chart's EA icon is colored after every reboot. A VPS exists to run unattended; skipping this check can cost you weeks of missed trades.
⑤ Demo vs real account mix-up
EA trades on demo but not on real (or vice versa)? First confirm which account the terminal is actually logged into. Two classic variants: the "disable algo trading when switching accounts" option killed the button during the switch, or the real account happens to be the one logged in with the investor password. The account number in the Navigator and the connection status in the bottom-right corner settle it in ten seconds.
Detecting the state from MQL5 (for EA developers)
The nasty part of 10027/10026 is the silence. Make your EA announce which layer is blocking it — in the log and with an alert — and your support burden collapses. Four functions cover the whole stack:
| Function | What it reflects |
|---|---|
TerminalInfoInteger(TERMINAL_TRADE_ALLOWED) | terminal-wide algo permission (button + Options) |
MQLInfoInteger(MQL_TRADE_ALLOWED) | this EA's permission on this chart |
AccountInfoInteger(ACCOUNT_TRADE_ALLOWED) | account may trade at all (false under investor login) |
AccountInfoInteger(ACCOUNT_TRADE_EXPERT) | account may trade via EAs (server-side setting) |
// Pinpoint which layer blocks autotrading and print it
bool CheckAlgoTradingAllowed()
{
bool ok = true;
if(!TerminalInfoInteger(TERMINAL_TRADE_ALLOWED))
{
Print("BLOCKED [Terminal]: AutoTrading button is OFF (toolbar / Ctrl+E) or disabled in Options");
ok = false;
}
if(!MQLInfoInteger(MQL_TRADE_ALLOWED))
{
Print("BLOCKED [Chart/EA]: 'Allow Algo Trading' is unchecked in this EA's Common tab");
ok = false;
}
if(!AccountInfoInteger(ACCOUNT_TRADE_ALLOWED))
{
Print("BLOCKED [Account]: trading not allowed - investor (read-only) login?");
ok = false;
}
if(!AccountInfoInteger(ACCOUNT_TRADE_EXPERT))
{
Print("BLOCKED [Server]: broker disabled EA trading for this account (retcode 10026)");
ok = false;
}
return ok;
}
How to wire it in
The proven pattern: check once in OnInit and warn — but don't fail.
int OnInit()
{
if(!CheckAlgoTradingAllowed())
Alert("EA loaded, but algo trading is blocked. See Experts log for the reason.");
return INIT_SUCCEEDED; // do NOT return INIT_FAILED here
}
Returning INIT_FAILED would force the user to re-attach the EA after enabling the button. If the EA stays loaded, trading resumes the instant the user turns Algo Trading on. In OnTick, log the state only when it changes (never every tick), so the Experts tab stays readable.
Also handle the two retcodes explicitly in your OrderSend() result path — a named log line makes post-mortems trivial:
if(res.retcode == TRADE_RETCODE_CLIENT_DISABLES_AT) // 10027
Print("Order rejected: AutoTrading disabled on YOUR terminal. Turn ON the Algo Trading button.");
else if(res.retcode == TRADE_RETCODE_SERVER_DISABLES_AT) // 10026
Print("Order rejected: broker disabled autotrading for this account. Contact your broker.");
The EAs distributed by FXEA365 show the AutoTrading ON/OFF state permanently on an on-chart dashboard, so a silently-blocked terminal is visible the moment you glance at the chart.
Priority checklist
| Priority | Check | Fix |
|---|---|---|
| 🚨 first | Algo Trading button is red (off) | click it on (Ctrl+E) |
| 🚨 first | EA icon in chart corner is gray | walk the 4 layers |
| ⚠️ next | Common tab "Allow Algo Trading" | tick and re-apply |
| ⚠️ next | Options permission + auto-disable boxes | enable / untick auto-disable |
| ✅ check | investor (read-only) login | re-login with trading password |
| ✅ check | 10026 (server-side rejection) | ask the broker about EA permission |
| 🛠 dev | EA fails silently | implement the layer-check code above |
Summary
- The #1 reason an EA never trades is disabled AutoTrading — and it fails silently, with no popup.
- 10027 = your terminal blocks it (you can fix it); 10026 = the broker blocks it (contact support).
- MT5 permission is a 4-layer stack: ① toolbar button, ② Options permission, ③ per-chart Common-tab checkbox, ④ the EA icon confirming the result. All must be on.
- The three big blind spots: investor-password logins, auto-disable on account switch, and VPS restarts bringing the terminal up with the button off.
- Developers: use
TERMINAL_TRADE_ALLOWED/MQL_TRADE_ALLOWED/ACCOUNT_TRADE_ALLOWED/ACCOUNT_TRADE_EXPERTso the EA reports exactly which layer is blocking.
For all error codes, see the complete MT5 error-code guide; for free EAs with an on-chart dashboard that surfaces this state at a glance, see the EA list.
FAQ
Q: I turned the Algo Trading button on, but the EA still won't trade.
Check the other layers — most often it's the per-chart "Allow Algo Trading" checkbox in the EA's Common tab. The final confirmation is the EA icon in the chart's top-right corner: colored means the stack is clear. If the icon is colored and there are still no trades, it's not a permission problem — the EA's entry conditions simply haven't fired (check the Experts log).
Q: What's the difference between 10027 and 10026?
10027 (TRADE_RETCODE_CLIENT_DISABLES_AT) means your own MT5 terminal disables autotrading — fixable in your settings. 10026 (TRADE_RETCODE_SERVER_DISABLES_AT) means the broker's server forbids autotrading for the account — nothing on your side helps; ask the broker whether the account type allows EAs.
Q: AutoTrading keeps switching itself off.
Look at Tools → Options → Expert Advisors: the "Disable algorithmic trading when switching accounts / profiles" checkboxes flip the button off automatically. MT5 updates can also bring the terminal up with the button off. On a VPS, make a post-reboot icon check part of the routine.
Q: Manual orders work, only the EA can't trade.
If manual trading works, the account is alive. The block is in the automation layer: the toolbar Algo Trading button or the per-chart Common-tab checkbox. Manual orders bypass the algo permission entirely, which is why this symptom points so precisely at it. If it persists and you see 10026, the broker restricts EA trading on the account.
Related
2026-07-07
Invalid Stops in MT5: Fix Retcode 10016 & MT4 Error 130
2026-07-07
Market Closed in MT5: Fix Error 10018 & 132 (Even on Weekdays)
2026-07-07
Off Quotes & Requote in MT5: Fix Errors 10021 / 10004 (and MT4's 136 / 138)
2026-07-07
Unsupported Filling Mode (MT5 Error 10030): The Fix When Your EA Stops Working on a New Broker
5-Day Email Course (Free)
Get one email a day covering the essentials of FX automated trading, how to read backtests correctly, and tips for choosing a broker.
* Privacy strictly protected. You can unsubscribe at any time.