The bot is on the chart. There is an icon in the top right corner. And nothing happens. No trade, no message, nothing. Before you start doubting the bot: it is almost never broken.
Short version first. MetaTrader 5 can block automated trading at four separate levels: the terminal itself, the individual EA, your account's EA permission on the broker's server, and the account itself. On top of that, the symbol can be restricted. Which of those five is stopping you is written in the Journal tab. Return code 10027 means your own terminal is blocking it and you are done in ten seconds. Return code 10026 means your broker has disabled EA trading on your account and there is nothing you can change. If there is no error at all, your bot never attempted an order and you are looking in the wrong place.
That last one is where people lose the most time. We work through it below in a fixed order. Go top to bottom and stop as soon as you have your answer.
Is there an error message, or is there nothing?
This is the first question and it splits the whole problem in two. Open the bottom panel in MT5 with Ctrl+T and look at the Experts and Journal tabs. If there is a line with a code or a reason, your bot did send an order and it was rejected. If there is nothing, only something like "automated trading enabled", your bot never tried to trade.
That difference decides where you look. A rejected order is a permission or settings problem. An empty log is something else entirely, and then every checkbox list is a waste of time.
The reason is in how an EA works. Your bot's code runs on the OnTick function, and according to the MQL5 documentation that only fires on a new tick for the symbol of the chart the EA is attached to. No ticks means no code. And without code there is no order, so no log line either. Nothing went wrong, nothing happened.
With an empty log there are three possibilities. No ticks are arriving, because the market is closed or the symbol is not in Market Watch. The entry conditions simply have not been met, for example because a spread filter or a time filter is blocking everything. Or the EA already quit on startup and therefore never trades.
An empty Experts tab means your bot never attempted an order. At that point every checkbox in the permission menu is a dead end.
Return code 10027 or 10026? That decides who can fix it
If you do have an error, look at these two codes first. They produce exactly the same symptom and have opposite fixes.
10027 means your own MT5 is blocking it. The log often shows the literal string [Auto Trading Disabled by Client]. Almost everyone then looks at the Algo Trading button in the toolbar, sees that it is green, and gives up. That button only covers half of it. The per-EA checkbox sits separately, and that is usually the gate that is shut. Press F7 on the chart, go to the Common tab and tick "Allow Algo Trading". That checkbox can reset itself when you re-attach the EA or when MT5 restores a saved template, while the toolbar button stays green the whole time.
10026 means your broker is blocking it. The log says "Autotrading disabled by server". No setting on your computer helps here, and neither does a VPS. This is a support ticket with your broker or prop firm, and that is the entire fix.
That distinction saves you a day of searching. Reading it costs five seconds.
The four levels where MT5 blocks automated trading
MetaQuotes documents this itself and it is the most useful way to think about it. Automated trading has to be allowed at four levels, and if one of them is shut, nothing happens.
Level 1, the terminal. The Algo Trading button in the toolbar, plus Tools, Options, Expert Advisors, "Allow Algo Trading". Turn this off and no EA trades at all, even the ones you enabled individually.
Level 2, the EA itself. The checkbox behind F7, per chart. This is the source of 10027 and the most-missed setting of the lot.
Level 3, your broker's server. Your account group is not allowed to use EAs. This is 10026.
Level 4, the account. This is the cause nobody spots. Per the MQL5 documentation an account cannot trade when there is no connection to the trade server, when the account is read only, when trading is disabled server side, or when you are logged in in investor mode. That last one happens more than you would think. Your broker gives you two passwords, and the investor password lets you see everything and execute nothing. MT5 then refuses every order without you doing anything wrong. Matching code: 10017, "Trade is disabled".
And then there is a fifth gate that behaves the same way in practice: the symbol. A symbol can be set to long only, short only or close only. A bot trying to short a long only symbol will never get there, and from the outside that looks like a broken bot.
Does the symbol name match? XAUUSD versus XAUUSD.a
This is one of the most common causes, and one of the easiest to skip past. Your bot is written for XAUUSD. Your broker calls gold XAUUSD.a, XAUUSD.pro, XAUUSD.raw, XAUUSDm or simply GOLD. As far as the bot is concerned the symbol does not exist, so it does nothing.
IC Markets Australia, for instance, calls gold XAUUSD.a, where the suffix marks the account type. Every EA and every signal built on XAUUSD goes quiet there. Indices are just as messy: US100, NAS100, USTEC and NAS100.cash are the same thing under four names.
Here is the fix. Open Market Watch with Ctrl+M, copy the exact name including capitals and suffix, and put that exact string in the bot's settings. And mind the second half of this: the symbol also has to actually be in Market Watch. A bot reading a symbol that is not listed gets no data back.
The symbol specification in 60 seconds
If you open one window for this problem, open this one. Ctrl+M, right click the symbol, Specification. Four numbers live there that between them explain most rejections.
Minimum volume and volume step. If your bot is set to 0.01 lots and the minimum is 0.1, every order gets rejected with 10014. If your bot calculates a lot of 0.037 while the step is 0.01, also 10014.
Stops level. This is the minimum distance for your stop loss and take profit, and it is expressed in points, not pips. On a symbol with 5 decimals, 30 points equals 3 pips. Put 20 in a StopLoss field because you meant 20 pips, and you are asking for 2 pips and getting 10016 back on every attempt.
That same factor-of-ten mistake also breaks spread filters. A MaxSpread of 20 on such a symbol means your bot refuses to trade above 2.0 pips of spread. On a live account with real spread that is basically never, and you get no error at all. The bot just sits there waiting for something that is not coming.
Trade mode. This tells you whether the symbol is fully tradable or set to long only, short only or close only.
What do the codes in the Journal tab mean?
These are the codes you actually run into, with the official meaning from the MQL5 documentation and what to do about them.
| Code | What MT5 says | What you do |
|---|---|---|
| 10014 | Invalid volume in the request | Lot too small, too large, or not a multiple of the step. Read min, max and step in the symbol specification. |
| 10016 | Invalid stops in the request | SL or TP is closer than the minimum. Note: the value is in points, not pips. |
| 10017 | Trade is disabled | Check that you logged in with the master password and not the investor password. |
| 10018 | Market is closed | Not a fault. That symbol's session is closed. |
| 10019 | There is not enough money | Not enough free margin. Watch free margin, not your balance. |
| 10021 | There are no quotes to process | No prices. The symbol is not in Market Watch or the feed is dead. |
| 10026 | Autotrading disabled by server | Your broker disabled EA trading. Only they can switch it back on. |
| 10027 | Autotrading disabled by client terminal | F7 on the chart and tick "Allow Algo Trading". Plus the toolbar button. |
| 10030 | Invalid order filling type | Shown in the log as "Unsupported filling mode". Your broker does not allow that filling type on this symbol. |
One more useful rule. MT5 codes are five digits and start with 100. If you are searching a three digit code like 130 or 134, you are reading MT4 advice. Different platform, different codes, and it will not get you anywhere.
It ran fine for months and then stopped
This deserves its own category, because the cause is almost never a setting you changed. There are three suspects.
Filling mode. Return code 10030, visible in the log as "Unsupported filling mode". Brokers decide which filling type is allowed per symbol, and they can change that without announcing it. A bot that ran well for months goes quiet from one day to the next. This is also the number one reason an EA ported from MT4 to MT5 does not work, because MT4 had no such concept at all.
Server time. MT5 brokers usually sit on GMT+2, GMT+3 in summer. A bot with a filter that only trades between 08:00 and 17:00 reads that server clock, not the clock on your wall. Twice a year the offset shifts with daylight saving, and your trading window moves without a single line of code changing.
An end date inside the bot. Demo versions and purchased EAs sometimes carry a licence that expires or a date the developer planted in the startup code. Typical symptom: it worked until the first of the month and then zero trades.
Is my bot broken or is the market just closed?
On Sunday evening a lot of people stare at a bot doing nothing while the forex market simply has not opened yet. The week starts around 17:00 New York time on Sunday, and gold opens an hour later than FX. Before that no ticks arrive, so your code does not run and nothing happens.
Same kind of misunderstanding with timeframes. A bot that only decides on a closed candle on H4 has six decision points per day. Seeing nothing for three hours is correct behaviour.
What also matters here is whether your bot keeps running when your laptop closes. It does not, which is why most people run their bot on a VPS. Why that matters and what it costs we covered separately in why a VPS matters for your trading bot.
Are two bots getting in each other's way?
If you have more than one EA on the same account, something else can be going on. Two bots with the same magic number each read the other's positions as their own. Both then conclude a trade is already open and there is nothing to do. Result: both idle, no error message anywhere.
And on a netting account MT5 holds only one position per symbol, so the second bot does not open a second position, it modifies the first one. More goes wrong there than just not trading. We worked that through in multiple trading bots on one account.
What to send support
If you cannot work it out yourself, keep it concrete. With these three things somebody can help you in one message instead of five rounds back and forth.
A screenshot of the Journal tab with the line containing the code. A screenshot of the Specification window for the symbol the bot is supposed to trade. And the top right corner of your chart, where you can see whether the EA is allowed to trade.
Without those three it is guesswork. With them it is usually clear inside a minute.
More background on the platform side sits in our piece on MT5, cTrader and TradingView for bots. And if you want to read your bot's risk rules before switching it on: risk management for a trading bot.
If you want to check the official source: MetaQuotes publishes the full list of trade server return codes and the four levels of trade permission. Those are the documents everything in this article traces back to.
Rather have a bot that is already set up correctly?
You open an account in your own name, we connect the strategy and get the settings right. Then you change your password. We take 30% of your profit and nothing when you lose.
Start with the bot