Home › Automation › MT5 won't run my EA

Why MT5 won't run my EA (and how to find out)

By Luis Sanches y Milton Bertillo, mentors at SHEFA Trading Academy · Updated 21 September 2026 · Reading time: 6 min

When an Expert Advisor ‘does nothing’, it is almost never broken: there are six causes that explain the vast majority of cases, and all of them can be checked in five minutes. The order matters: starting with the code when the problem was a permissions issue is the most common way to waste an afternoon.

The six causes, in order of frequency

SymptomCommon causeCheck
The Expert Advisor is on the chart but nothing happens The algorithmic trading is disabled: the button on the top bar, the terminal's global permission or the Expert Advisor's own permission. ‘Algorithmic trading’ button in green (not red) and terminal settings with algorithmic execution allowed. Also, the corresponding permission must be ticked in the Expert Advisor's properties.
Only a sad face appears next to the name The Expert Advisor has been added to the chart without trading permission or with initialisation errors. Check the permissions in the Expert Advisor's properties and the ‘Experts’ tab: if initialisation failed, the reason appears there.
There are no messages or errors The Expert Advisor is waiting for its entry conditions. An Expert Advisor with a trend, time or volatility filter can spend hours without trading by design. Check in the code whether it prints messages and whether it has time or session filters. Watch out for the server time, which is not yours.
It tries to trade and does not enter Execution rejection: stops too close to the price, volume below the minimum, insufficient margin, market closed or read-only account. ‘Journal’ tab: the terminal logs the rejection with its error code. That code is the answer (check the official MQL5 documentation).
The symbol is not the right one The expert advisor trades a specific symbol name, and on your broker it's called something different (or the chart is on another instrument). Check the chart symbol and the one the expert advisor uses internally: they must match. Names change between brokers.
It works on demo but not on live The live account has different available symbols, a different minimum volume, different margin or a different hedging mode. Compare the symbol list, minimum volume, spread and account mode between demo and live.

Five-minute diagnosis

  1. Algorithmic trading enabled (green bar at the top) and the expert advisor permission ticked.
  2. Look at the ‘Experts’ tab: Is the expert advisor printing anything? Did it initialise properly?
  3. Look at the ‘Journal’ tab: look for lines with ‘trade’, ‘order’ or ‘error’. That's where the rejection is, with its code.
  4. Check the chart: correct symbol, timeframe with data and price updating.
  5. Check the expert advisor's filters: schedules, sessions and thresholds that may never be met.
  6. Test with a minimal expert advisor that only tries to open a very small position without stops. If that works, the channel is fine and the problem is configuration or logic.
The official MQL5 documentation has a table of runtime and compilation error codes: it's the reference for translating the Journal number into a specific cause (Error codes).

If the problem is in the code

Before blaming the broker

Server-side rejections do exist (market closed on a symbol with a schedule, read-only account, symbol disabled for that account type), but they're the minority. The test that rules it out is simple: a minimal expert advisor that tries to open the minimum permitted volume, without stops, on the correct symbol. If that order goes through, your execution channel works and the problem is in your configuration or your logic.

Remember that automating doesn't eliminate risk: an expert advisor executes rules, it doesn't predict the market. If your system isn't measured, automating it only executes an uncertain outcome faster.

Frequently asked questions

Why does it appear on the chart but not open trades?

Because of disabled permissions, the wrong symbol, entry conditions that aren't met (or poorly adjusted time filters) or execution rejections due to stops, volume or margin. The Journal says which.

Where can I see why it isn't executing?

In ‘Experts’ (messages from the expert advisor itself) and in ‘Journal’ (server rejections with their error code).

Why does it work on demo but not on live?

Because available symbols, minimum volume, spread, margin and account mode change. Compare them before touching the code.

Can it be the broker?

It is possible, but rare. A minimal Expert Advisor that attempts a small, valid trade is enough to rule it out.

Does an uncompiled Expert Advisor run?

No: without a compiled file it cannot be added to the chart. Fix the errors and recompile.

Measure first, automate afterwards

At the academy, Expert Advisors are used for what risk requires: calculating position size according to risk, placing stops, respecting limits and schedules. See what can truly be automated.

Automation guides →

Keep reading

Risk warning. Synthetic indices and CFDs are leveraged products with high risk of loss. Educational content, not financial advice.