Back to guides
MT5 EA Not Trading? Algo Trading, Errors 10027 and 4752, and 6 Other Causes

MT5 EA Not Trading? Algo Trading, Errors 10027 and 4752, and 6 Other Causes

Benjamin F., Co-founder8 min read

An MT5 EA that is not trading can be attached to its chart, connected and receiving instructions, and still place no orders at all. MetaTrader 5 checks several permissions before any automated order leaves the terminal, and each one lives in a different place, such as the toolbar, the EA's properties, the platform options, your login, the broker or the symbol, so a single switch turned off anywhere is enough to block every trade.

The error the terminal reports tells you which of those permissions to look at. The table below maps each code to its cause, and the sections after it explain how to fix them one by one.

You seeConstantWhat it means
Retcode 10027TRADE_RETCODE_CLIENT_DISABLES_ATAlgo Trading is off in the terminal
Error 4752ERR_TRADE_DISABLEDThis EA is not allowed to trade
Retcode 10026TRADE_RETCODE_SERVER_DISABLES_ATThe broker's server has disabled automated trading
Retcode 10017TRADE_RETCODE_TRADE_DISABLEDTrading is disabled for the account or symbol
Retcode 10044TRADE_RETCODE_CLOSE_ONLYThe symbol only accepts closing orders
No error and no tradenoneThe EA is not running, or its own filters skipped the order

The constants and descriptions are MetaQuotes' own, taken from the trade server return codes and runtime error codes references.

1. Error 10027: autotrading disabled by client terminal#

The Algo Trading button in the main toolbar, labelled AutoTrading in older builds, is the master switch for every EA in the terminal. When it is off, MT5 refuses every automated order with retcode 10027, which MetaQuotes describes as "Autotrading disabled by client terminal." Click the button so that it shows as enabled, and bear in mind that Ctrl+E toggles it as well, which is how it most often gets switched off by accident.

2. Error 4752: the EA itself is not allowed to trade#

Turning on the toolbar button is not enough on its own. Each EA also has its own Allow Algo Trading setting, and both have to be on for that EA to trade. The EA's setting overrides the terminal-wide switch for that one EA. When it is unticked, the EA cannot trade even though the toolbar shows Algo Trading as enabled and other EAs in the same terminal trade normally. Its orders then fail with runtime error 4752, "Trading by Expert Advisors prohibited."

To check it, open the EA's properties from the chart, for example with F7, and make sure Allow Algo Trading is ticked on the Common tab. Older builds label it Allow Auto Trading. The override only works in one direction, so ticking it cannot make the EA trade while the toolbar button is off.

New EAs take their default from Allow algorithmic trading on the Experts tab of Tools → Options, labelled Expert Advisors in older builds, but changing that option does not update EAs that are already attached, so always check the Common tab of the EA you are actually using.

3. MT5 switched algo trading off for you#

The same Options tab contains settings that disable algorithmic trading automatically when you switch account, switch profile, or change the symbol or timeframe of the chart the EA is on. They exist as a safety measure so that an EA does not start trading a live account you have just logged into, but the side effect is that a routine change, such as logging into a different account on the same terminal, can sometimes turn automation off. If trading stops after one of those actions, re-enable the Algo Trading button, and untick the matching option if you prefer, while keeping the account option on if you regularly move between demo and live logins.

4. You logged in with the investor password#

Every MetaTrader account has two passwords: the master password allows trading, while the investor password is read-only, so the terminal can display the account, its balance and its positions while refusing every order. Prop firms and account managers often hand out investor access for monitoring, which makes it easy to save the wrong one. Log in again through File → Login to Trade Account with the master password, and if you write your own EAs, AccountInfoInteger(ACCOUNT_TRADE_ALLOWED) returns false on an investor login.

5. Error 10026: the broker has disabled EA trading#

Some account types, and some prop firm programs, do not allow Expert Advisors at all, in which case the broker's server refuses automated orders with retcode 10026, "Autotrading disabled by server," whatever your terminal settings say. In MQL5, the matching account flag is ACCOUNT_TRADE_EXPERT, and since only the broker can change it, ask whether your account type permits EAs and check your prop firm's rules before you automate an evaluation.

6. The symbol is disabled or close-only (10017, 10044)#

A symbol can be tradeable on one account type and restricted on another. Open the symbol's specification from Market Watch and read its Trade field. A symbol set to close only returns 10044 for new entries, and a disabled one returns 10017. Outside the symbol's trading session you will see 10018 instead, which our guide to the MT5 market closed error covers.

7. The EA is not actually running#

An EA that failed to start never reached the code that places orders, so it leaves no trade errors at all. Check the Experts and Journal tabs under View → Toolbox right after you attach it. An EA that relies on a DLL will not load if DLL imports are blocked, and one that cannot reach its service usually says so there. Our guide to allowing DLL imports in MT5 covers the DLL case. A closed laptop, a sleeping computer or a VPS that restarted for updates stops every EA on it, so it is also worth confirming that the terminal is still logged in and online.

8. The EA's own filters skipped the order, or another EA got in the way#

Most EAs apply their own rules on top of MT5's, such as trading hours, spread limits, maximum positions or news filters. When one of those refuses an order, the EA usually prints its own message rather than an MT5 code, so read the Experts tab for lines from the EA itself and review its inputs before assuming the platform is at fault.

Two automated tools on the same account can undo each other's work without either of them reporting an error, so it is also worth checking whether another EA is running at the same time. MT5 allows only one EA per chart, so a conflicting EA usually sits on a different chart in the same terminal, or in a second terminal logged into the same account, such as a copy on your home computer alongside the one on your VPS. A risk manager that closes positions above a loss limit, a copier, or an older version of the same EA can close or block trades in ways that look like your EA never traded at all.

To see every EA running in a terminal, right-click any chart and choose Expert List, then do the same in any other terminal that uses the account. Remove anything you no longer need, and for the EAs you keep, check that each one only manages its own trades, usually by giving each a different magic number. With PineHook in particular, keep exactly one PineHook chart per license. A second chart using the same license takes over the connection and disconnects the first.

How PineHook checks every permission for you#

Working through eight possible causes by hand is exactly what PineHook is designed to spare you. Signal Logs → Test EA Connection sends a test through the live route to your license without placing a trade, and the MT5 result shows four flags side by side: AutoTrading, EA trading, account trading and whether the account allows EAs. The EA prints the same line in the Experts tab with a plain warning that trades will not execute until every flag is on, so a permission problem is found before your first alert rather than after it.

When an alert does fail, its row in Signal Logs says why in plain language. A permission refusal shows the broker's description beside its code, a block from one of your own PineHook settings names that setting, and our guide to webhook delivered but no trade lists the messages you are most likely to meet. You can create a PineHook account without payment details and run the connection test on your own terminal in a couple of minutes.

FAQ#

What is the difference between MT5 error 10027 and 4752?

10027 comes back in the result of a trade request and means the terminal-wide Algo Trading switch is off, while 4752 is a runtime error raised inside the EA when that particular EA has not been allowed to trade. Check the toolbar button for the first and the EA's Common tab for the second.

Is MT5 error 4109 the same problem?

4109 is MT4's code for this problem, and in MT5, the number 4109 means something unrelated to trading. Our guide to MT5 error 4109 explains the difference.

Does an MT5 EA need a VPS to keep trading?

The terminal has to stay running and logged in for any EA to trade, and a VPS is the usual way to achieve that, although any computer that stays on and online will work.

MetaTrader is a trademark of MetaQuotes, and PineHook is an independent product that is not affiliated with, endorsed by, or sponsored by MetaQuotes. Leveraged trading carries a high risk of loss, so test any automated setup on a demo account before you trade it live.

ShareX

Related posts