10 checks when an MT5 Expert Advisor is not opening trades
- Confirm the EA is attached and initialized. Check the intended chart and the Experts log after attaching the EA. An initialization failure, missing indicator or invalid input needs fixing before you investigate entry rules. An MT4 EX4 file is not an MT5 EX5 build.
- Check the platform Algo Trading control. MT5 has a terminal-level automated-trading permission. Seeing prices update or indicator objects appear does not prove the EA can submit orders.
- Check this EA's own permission. Open its properties and check the automated-trading setting. Terminal permission and program permission are separate checks; one enabled switch does not establish both.
- Check the account and connection. Confirm the correct broker server and an active connection. A login with the investor password is read-only. Account-level or broker-side restrictions can also prohibit automated orders.
- Use the broker's exact symbol. EURUSD, EURUSD.a and EURUSDm are different names. Verify that the symbol selected by the EA exists, has prices and matches the configured instrument. Multi-symbol EAs need data for every instrument they inspect.
- Confirm a valid setup actually occurred. Compare the candle, timeframe and input settings with the written entry rule. A strategy that waits for a candle close may deliberately ignore an intrabar signal. Ask for a log showing which entry condition passed or failed.
- Inspect the filters. Session hours, server-time conversion, spread limits, a daily trade cap, existing-position checks and an equity guard can block an otherwise valid entry. Identify the active blocker before changing a limit.
- Validate volume and stops. Requested lots must match the broker's volume constraints. Stops must be on the correct side and meet the symbol's distance and price rules. A position-size estimate is not automatically a valid broker order.
- Separate tester results from live integrations. For an EA that uses MQL5 WebRequest, the server URL must be allowed in terminal options. WebRequest is unavailable inside the Strategy Tester; test the network path separately or replay recorded inputs through a test adapter.
- Capture the order result. If the EA reached order submission, record the trade result's retcode, comment, requested volume, symbol and prices. Reattaching the EA repeatedly will not explain a broker rejection. Reproduce the issue on a demo account with one controlled change at a time.
The five permission and connection flags to log
For a custom EA, ask the developer to log these values from the EA's own execution context. This gives a clearer diagnosis than a screenshot of the toolbar alone.
| Check | MQL5 value | What it tells you |
|---|---|---|
| Terminal connection | TERMINAL_CONNECTED | Whether the terminal is connected to the trade server. |
| Terminal permission | TERMINAL_TRADE_ALLOWED | Whether automated trading is enabled at terminal level. |
| This EA's permission | MQL_TRADE_ALLOWED | Whether this running MQL5 program is allowed to trade. |
| Account permission | ACCOUNT_TRADE_ALLOWED | Whether the account permits trading. |
| Account automation | ACCOUNT_TRADE_EXPERT | Whether the account permits Expert Advisor trading. |
Common MT5 trade return codes and what to check
These are broker trade-server return codes in MqlTradeResult.retcode. They are a different diagnostic channel from the terminal's GetLastError() value. Always keep the code's name and the broker comment together.
| Code | Meaning | Next check |
|---|---|---|
10014 | Invalid volume | Compare requested lots with the symbol's minimum, maximum and volume step. |
10016 | Invalid stops | Check stop direction, price precision and the broker's required stop distance. |
10018 | Market closed | Confirm this symbol's trading session and broker server time. |
10019 | Insufficient money | Inspect free margin and the margin required for the requested order. |
10027 | Client terminal disables automated trading | Recheck terminal Algo Trading permission and the EA's own setting. |
10030 | Invalid filling type | Use a filling policy supported by the symbol and the intended order type. |
A useful fix changes the cause and then demonstrates a valid order result. Adding unlimited retries to the same rejected request can obscure the cause and introduce duplicate-order risk.
What to send your MT5 developer
Provide a small reproducible report: the EA version, terminal build, broker server, exact symbol, timeframe, input settings and the server-time timestamp of the expected trade. Add the nearby Experts and Journal lines, the trade retcode and an explanation of the entry condition you expected to pass.
Describe whether the issue also happens in the Strategy Tester or on a demo account. For symbol or sizing errors, include the relevant symbol specification. Hide account passwords, API tokens and unrelated personal details; a diagnostic report does not need those secrets.
Common questions
Why does my EA draw objects but never open a trade?
Chart drawing and order submission are separate operations. The EA may have trading disabled, lack an entry condition, hit a filter or receive a broker rejection. Log those stages separately.
Why does an EA trade in the tester but not on my account?
Compare symbol settings, inputs, account permissions and the actual market conditions. External network access is another difference: a WebRequest-based integration cannot run unchanged in the Strategy Tester.
Can you repair an existing EA?
We can scope MQL4/MQL5 debugging when the source code or a clearly reproducible problem is available. Send the diagnostic details above so the repair can have a defined acceptance test.
Official documentation
The platform facts and error-code definitions above are based on these primary references. The diagnostic workflow and bridge design are our implementation recommendations.