Homeใ€€>ใ€€EA & MT5 Knowledge Baseใ€€>ใ€€MT5 Error Codes

TroubleshootingMT5Intermediate

MT5 Error Codes โ€” Why Your EA Stops Trading and How to Fix It

Last updated: 2026-05-20 | Estimated reading time: 15 min

"I installed the EA but it's not trading" or "order errors suddenly started appearing" โ€” these situations are inevitable in EA operation. MT5 leaves clues in its logs. This article explains the most common error causes, how to fix them, and how to read the logs.

Three things to check first

When an EA behaves unexpectedly, start with these three checks. Most issues are resolved here.

1

Is "Algo Trading" enabled?

Check the "Algo Trading" button in the toolbar and the smiley-face icon in the top-right corner of the chart. A frowning face means automated trading is disabled.

2

Is MT5 connected to the broker?

Check that the connection indicator in the bottom-right of the screen is green. If it is red or shows "No connection", try logging in again or check your network.

3

Is trading allowed in the EA's settings?

Open the EA's Properties and go to the Common tab. Confirm that "Allow Algo Trading" is checked.

Reading the logs โ€” Journal and Expert tabs

The Terminal window at the bottom of MT5 records what is happening. Use these two tabs depending on what you need to find:

TabWhat it records
ExpertThe EA's own activity log โ€” entry decisions, order results, errors and messages output by the EA
JournalMT5's system log โ€” connection status, algo trading enabled/disabled, communication errors with the server

To find out why an EA is not trading, check the Expert tab. To check whether MT5 or the EA is running at all, check the Journal tab. The key is to read the entries around the date and time when the problem occurred.

Common order error codes

When an order fails, an error code appears in the EA's log. The most common ones are listed below.

ErrorMeaningWhat to do
10004 RequoteThe quoted price changed and the order could not be filledUsually temporary. The EA's retry logic will often recover automatically
10006 Request rejectedThe server rejected the orderCheck account status, trading hours, and the symbol
10016 Invalid stopsSL/TP is too close to the current price or contains an invalid valueMake sure SL/TP are placed beyond the broker's minimum stop level
10019 Insufficient fundsNot enough margin to open the positionReduce the lot size or deposit more funds
10027 Algo trading disabledAlgorithmic trading is turned offEnable the "Algo Trading" button
10018 Market closedAn order was placed while the market was closedVerify that trading hours are open. This often happens with daily-timeframe EAs placing orders at rollover
Error codes may vary slightly between MT5 versions and their wording. Search the Journal/Expert by code number and read the surrounding context to identify the root cause.

Why an EA might stop trading (without an error)

If no error appears yet the EA is not trading, consider the following causes.

1

Entry conditions have not been met yet

An EA only places orders when its conditions are satisfied. H4 and D1 EAs with no trades for several days to several weeks are completely normal. First confirm the EA's expected trade frequency.

2

Spread is above the maximum limit

Many EAs stop new entries when the spread exceeds MaxSpread. Spreads widen during early-morning sessions and around news releases, so the EA may pause only during those windows.

3

A filter has suspended trading

Safety mechanisms such as the economic news filter, trading hours filter, consecutive-loss stop, or daily loss limit may have triggered. The reason will appear in the log.

4

Symbol name mismatch

An EA designed for GOLD attached to an XAUUSD chart, for example, may not work due to a symbol name mismatch. Confirm the exact symbol name used by your broker.

5

Wrong timeframe or insufficient historical data

Attaching the EA to the wrong timeframe chart, or a lack of sufficient historical data, can also prevent trading.

Systematic troubleshooting when errors persist

If you cannot identify the cause, work through the following steps in order.

Step 1

Identify the error in the logs

In the Expert / Journal tab, note the date, time, error code, and message.

Step 2

Try to reproduce the problem on a demo account

Run the same settings on a demo account and see whether the problem occurs. If it does, the issue is with the EA or its settings. If it does not, the issue is with the account or the connection.

Step 3

Reset settings one by one to isolate the cause

Return filters and parameters to their default values one at a time to identify which one is causing the problem.

Step 4

Restart MT5 and the EA

Restarting MT5 or re-attaching the EA to the chart can clear temporary issues. On a VPS, a reboot may also help.

Step 5

If unresolved, contact the EA provider

Include the error details from the log, the symbol, timeframe, and your settings when contacting the EA provider or your broker.

๐Ÿ–ฅ๏ธ Stabilize your trading environment with a VPS

Many problems caused by connection drops and reboots can be prevented by running your EA on a VPS.

Read the VPS setup guide โ†’

Frequently Asked Questions

Q: I attached the EA but the smiley icon does not appear.

First check that the "Algo Trading" button in the toolbar is enabled. Then open the EA's Properties and confirm that "Allow Algo Trading" is checked on the Common tab. Both must be on for the smiley icon to display.

Q: I keep getting an "Invalid stops (10016)" error.

Your SL/TP is either too close to the current price or violates your broker's minimum stop level. Check the broker's minimum stop level and set SL/TP further away. Increasing the EA's SL/TP distance parameters usually resolves this.

Q: No error appears, but the EA has not traded in days.

This may not be abnormal. H4 and D1 EAs have a low trade frequency, and going several days to several weeks without an entry is perfectly normal. First verify the EA's expected trade frequency, then check the log for any messages about spread limits or active filters.

Q: "Market closed (10018)" errors are appearing repeatedly.

Orders are being placed while the market is closed. This commonly happens when a D1 EA tries to place an order at the daily rollover. Review the EA's trading hours settings or use a trading hours filter to restrict orders to market-open periods.

Q: Which log should I check โ€” the Journal or the Expert tab?

Use the Expert tab when you want to understand the EA's decisions and order results. Use the Journal tab when you want to check MT5's connection status or whether algo trading is enabled. During troubleshooting, check both tabs and read the entries around the time the problem occurred.