PipWardenStart free

MT5 Algo Trading button: errors 10027, 10026 and why it turns off

What the MT5 Algo Trading button controls, why it switches off by itself, and how to fix AutoTrading disabled by client (10027) and by server (10026).

Key takeaways

  • The MT5 Algo Trading button (Ctrl+E) is a terminal-wide switch. While it is off, Expert Advisors keep running but cannot open, change or close any trade.
  • Error 10027 means a switch in your own terminal is off. Error 10026 means the broker’s trade server has disabled automated trading for the account.
  • An EA trades only when the toolbar button is on and Allow Algo Trading is ticked on the EA’s own Common tab (F7).
  • With the matching option ticked, MT5 switches algo trading off after an account or profile change, and stops the EA on a chart whose symbol or timeframe you change. Moving EAs to virtual hosting switches it off locally.
  • Turning Algo Trading off does not close positions. Stop loss and take profit stay at the broker, but anything the EA manages itself, such as a trailing stop, stops moving.
On this page
  1. What the MT5 Algo Trading button controls
  2. The switches that must all be on
  3. Error 10027: AutoTrading disabled by client
  4. Error 10026: AutoTrading disabled by server
  5. Why Algo Trading keeps turning off by itself
  6. The disable options in Tools → Options → Expert Advisors
  7. After moving EAs to MetaQuotes’ virtual hosting
  8. An EA that removes itself, or a tool that presses the button
  9. When Algo Trading is on but nothing trades
  10. Using it as an emergency brake
  11. Checklist: six checks in order
  12. How PipWarden handles the switch

The MT5 Algo Trading button in the toolbar (Ctrl+E) is the terminal-wide switch for Expert Advisors: green means they may trade, red means no EA on any chart can open, change or close a trade, and an EA that tries gets error 10027. Error 10026 comes from the other end: the broker’s server has turned automated trading off for the account, and nothing in your terminal can switch it back on.

What the MT5 Algo Trading button controls

The MetaTrader 5 help and some log messages still call it AutoTrading, the name MT4 uses (MQL5 forum). The MT5 hotkeys list Ctrl+E as “Allow/prohibit use of Expert Advisors”. The icon shows a green play sign when trading is allowed and a red stop sign when it is not.

It is the terminal’s permission for algo trading, not a power switch. The MT5 help says: “If it is disabled, scripts and Expert Advisors can work, but are not able to trade.” An Expert Advisor (EA) keeps running, and every trade request it sends is refused. The button closes nothing: positions stay open until their stops, their targets or you close them.

The switches that must all be on

Switch Where Scope
Algo Trading button Toolbar, or Ctrl+E Every EA in the terminal
Allow algorithmic trading Tools → Options (Ctrl+O) → Expert Advisors Every EA in the terminal
Allow Algo Trading The EA’s properties (F7) → Common tab That one EA on that one chart

The first two are one setting in two places: the help describes the toolbar button “(and a similar option in Options → Expert Advisors)” as the switch for automated trading in the whole platform. If it is off, no EA may trade, whatever its own settings say (MT5 help).

The third is per chart. It appears on the Common tab when you drag an EA onto a chart, and later with F7. The EA’s name and a small icon in the chart’s top-right corner show whether that EA may trade.

A last permission is not yours to set: the broker’s. That is error 10026.

Error 10027: AutoTrading disabled by client

The MQL5 reference lists 10027 as TRADE_RETCODE_CLIENT_DISABLES_AT, “Autotrading disabled by client terminal” (MQL5 return codes). The order never left your computer. A typical line in the Experts tab reads OrderCheck() failed: AutoTrading disabled by client (10027), though the exact wording depends on the EA (MQL5 forum).

Check these in order:

  1. The toolbar button is red. Click it or press Ctrl+E.
  2. The EA’s own box is unticked. Click the chart, press F7, open the Common tab and tick Allow Algo Trading.
  3. You moved the EA to MetaQuotes’ virtual hosting. The local terminal is blocked on purpose; the hosted copy is the one that trades.

If the error comes back after a fix, something is switching it off. The causes are below.

Error 10026: AutoTrading disabled by server

10026 is TRADE_RETCODE_SERVER_DISABLES_AT, “Autotrading disabled by server”. The MQL5 documentation explains that “Automated trading can be disabled at the trade server side”, and then “trading operations of Expert Advisors/scripts are not executed” (MQL5 trade permissions). In the Journal, the failed order line ends in [AutoTrading disabled by server] (MQL5 forum).

The block is set on the broker’s side, so orders fail even with every switch on. A manual order from the same account may still go through. The fix is a message to support:

My MT5 account [login] on server [server name] rejects orders from Expert
Advisors with "AutoTrading disabled by server" (10026). Is automated trading
allowed on this account type? If not, can it be enabled, or which account
type allows it?

If the answer is no, the remaining route is another account type or broker. Our MT5 broker list is a compatibility reference, not a recommendation; the account type still has to allow EAs.

Why Algo Trading keeps turning off by itself

MT5 does not switch it off at random. These are the usual causes.

The disable options in Tools → Options → Expert Advisors

Four boxes sit under Allow algorithmic trading (MT5 help):

Option, as labelled in the dialog What happens when it is ticked
Disable algorithmic trading when the account has been changed Logging in to another account switches algo trading off
Disable algorithmic trading when the profile has been changed Loading another profile switches it off
Disable algorithmic trading when the charts symbol or period has been changed Changing a chart’s symbol or timeframe prohibits the EA on that chart from trading
Disable algorithmic trading via external Python API Blocks trading by Python scripts that use the MetaTrader 5 module

The first two are protections that work as designed, for example when you switch from a demo account to a live one. The third catches people out, because the toolbar button stays green.

Changing timeframes on a second chart avoids it.

After moving EAs to MetaQuotes’ virtual hosting

The hosting help states: “When you transfer Expert Advisors, the automated trading function is automatically disabled in the local platform.” The point is to stop “two platforms connected with the same account” trading “through the same Expert Advisor” (MT5 help).

So a red button on your home PC after a migration is expected; switching it back on would let the same EA trade the account twice. More in our guide to a VPS for an EA and the forex VPS entry.

An EA that removes itself, or a tool that presses the button

Some EAs unload themselves after an error with ExpertRemove(), which “stops an Expert Advisor and unloads it from a chart” (MQL5 reference). The button stays green, but the EA’s name is gone from the chart corner. Its last messages in the Experts tab (View → Toolbox, Ctrl+T) usually say why.

A program allowed to import DLLs can also press the button through Windows API calls (example in the MQL5 Code Base). If it turns red while such a utility runs, check that utility first.

When Algo Trading is on but nothing trades

Sometimes the switches are fine and the account itself cannot trade. The MQL5 documentation lists the cases:

  • Investor password. A read-only login lets you “see the account status, analyze prices, and work with your own Expert Advisors, but not trade” (MT5 help). The Journal shows trading has been disabled - investor mode. Log in with the master password.
  • No connection to the trade server (10031, “No connection with the trade server”).
  • A read-only or archived account, or trading disabled on the server. One broker’s troubleshooting guide says this happens automatically when the balance is 0 or when no trading activity has been registered for some time.

Other return codes look similar: 10017 “Trade is disabled”, 10018 “Market is closed”, and 10044 when the symbol allows only closing positions. For 10018, compare the time with the sessions in the forex market hours tool.

A quick test: if a manual order from the New Order window (F9) fails too, the problem is the account or the symbol, not the Algo Trading switch.

Using it as an emergency brake

Ctrl+E stops every EA in the terminal from trading. Here is what it leaves behind:

Action New EA orders Open positions Stops at the broker Trailing or breakeven run by the EA
Algo Trading off Blocked Stay open Stay in place Stop moving
Remove the EA That EA stops Stay open Stay in place Stop
Kill switch Blocked Closed at market Gone with the position Not needed

Stop loss and take profit orders sit on the broker’s server; anything the EA does itself needs the terminal and the trade permission. Even MT5’s built-in trailing stop “will not work, unlike the above orders, if the platform is off” (MT5 help).

A kill switch closes positions instead of freezing them. In PipWarden, it cancels pending entries, stops the bot and closes every position the bot opened, identified by its magic number. Manual trades are left alone.

The catch with any kill switch that works through an EA: closing is a trade request, so it needs Algo Trading on. Pressed while the button is red, it cannot close anything. In PipWarden, a failed close (market closed, Algo Trading off) is retried once a minute while the kill switch is on, and you get an alert that positions are still open.

Checklist: six checks in order

  1. Master password, and connected (investor mode, 10031).
  2. Algo Trading button green (10027 with a red button).
  3. Tools → Options → Expert Advisors: the disable options set as you intend (account, profile, chart change).
  4. F7 → Common → Allow Algo Trading ticked (10027 with a green button).
  5. The EA’s name still in the chart’s top-right corner (an EA that unloaded itself).
  6. EAs allowed on the account by the broker (10026).

If all six pass and the EA still does not trade, the cause is not a permission. Our guide to an EA not taking trades covers the rest, and the MT5 install guide walks through the setup from the start.

How PipWarden handles the switch

PipWarden runs as an EA in MT5 on a Windows PC or VPS, so it needs the same switches and a broker that allows EAs, and it cannot run on a phone. Before every order, the EA checks the permissions itself and names the one that is off:

  • Algo Trading is disabled in the terminal when the button is red.
  • algorithmic trading is disabled in the EA properties when Allow Algo Trading is unticked.
  • trading is not allowed on this account (investor password?) for a read-only login.
  • automated trading is disabled by the broker when the broker blocks EAs.

It then sends nothing to the broker. The signal log marks the signal as blocked and shows that message, and you get an alert by email or Telegram, depending on your notification settings.

A red button does not take the EA offline: it keeps reporting to the dashboard, so the problem shows up at the next trade signal rather than as an “Expert Advisor offline” alert. While the button is off, breakeven, trailing stop and partial close pause; the stops already placed stay at the broker. See the features page and how it works.

Forex and CFD trading is high risk, and you can lose money. This page explains how MetaTrader 5 works and is not financial advice. Read the risk disclosure before you trade.

Frequently asked questions

What is error 10027 in MT5?
Error 10027, “Autotrading disabled by client terminal”, means your own terminal refused the order because the Algo Trading button or the EA’s own Allow Algo Trading box (F7 → Common) is off. Switch both on.
What is error 10026 in MT5?
Error 10026, “Autotrading disabled by server”, means the broker’s trade server has automated trading disabled for this account, so no setting in your terminal fixes it. Ask the broker whether EAs can be enabled, or which account type allows them.
Why does Algo Trading turn off when I change the chart timeframe?
Because “Disable algorithmic trading when the charts symbol or period has been changed” is ticked in Tools → Options → Expert Advisors, so changing the chart’s symbol or timeframe prohibits its EA from trading. Untick it, or change timeframes on a second chart. To let the EA trade again, tick Allow Algo Trading in F7 → Common.
What is the keyboard shortcut for Algo Trading in MT5?
Ctrl+E, listed in the MT5 hotkeys as “Allow/prohibit use of Expert Advisors”. F7 opens the properties of the EA on the active chart, where the Common tab holds its own Allow Algo Trading box.
Does turning off Algo Trading close my open trades?
No. Open positions stay open, with their stop loss and take profit at the broker. The EA cannot open, modify or close anything, so a trailing stop or breakeven it manages stops moving until you switch Algo Trading on.

Educational content, not financial advice. Forex and CFDs are traded on margin and are high risk: you can lose money, and more than your deposit with some brokers. Examples use made-up numbers and show no real results. Read the risk disclosure.