MetaTrader Common Errors: MT4 and MT5 Codes, Causes and Server-Side Fixes
A practical reference to the MT4 error codes and MT5 trade server return codes clients see most, split into what the trader can fix and what the broker must fix on the server.
MetaTrader common errors explained: MT4 and MT5 trade server return codes, no connection, invalid stops, off quotes and what brokers should check on the server.
How MetaTrader reports errors
MetaTrader reports errors as numbered codes with fixed names that MetaQuotes documents, and the number tells you where in the chain the request failed. MT4 and MT5 use different numbering, so the same problem has two different codes depending on the platform.
In MetaTrader 5, every trade request gets a reply from the trade server. MetaQuotes describes the mechanism like this:
"All requests to execute trade operations are sent as a structure of a trade request MqlTradeRequest using function OrderSend(). The function execution result is placed to structure MqlTradeResult, whose retcode field contains the trade server return code."— MQL5 Reference, Trade Server Return Codes, MetaQuotes (accessed October 2026)
MT5 trade server return codes run from 10004 (TRADE_RETCODE_REQUOTE) to 10046 (TRADE_RETCODE_HEDGE_PROHIBITED). In MetaTrader 4, the same kind of information comes from GetLastError(). Trade-related codes sit in the low range (0–150, for example 130 ERR_INVALID_STOPS). Program runtime errors start at 4000 (for example 4109 ERR_TRADE_NOT_ALLOWED).
A success code is not the same as a filled order. The MQL5 reference for OrderSend() warns that "a successful result of the OrderSend() function does not mean that the order has been executed". It only means the request was accepted for further processing. When a client says "it said OK but nothing happened", check the server journal.
There are three places to look for the real code:
- Journal tab (platform events: connection, login, order requests).
- Experts tab (messages printed by Expert Advisors and scripts, including
GetLastError()results). - Log files on disk. MetaQuotes' MT5 help states: "The platform log files are stored in the Logs directory, and Expert log files are saved in MQL5\Logs. File names correspond to the date of journal generation — YYYYMMDD.LOG."
The built-in log viewer can filter entries by "Full, No connection, Errors only".
Client-side vs server-side: who has to fix it
The quickest triage question is whether one trader sees the error or many do. One client with one error is usually a client-side problem. The same error across many accounts, a symbol or a group almost always points to the server, the symbol configuration or the liquidity side.
| Symptom or code | Usually client-side when… | Usually server-side when… |
|---|---|---|
| "No connection" / 6 ERR_NO_CONNECTION / 10031 TRADE_RETCODE_CONNECTION | One user, local internet, firewall, proxy or wrong server name | Many users at once, access point down, IP or DNS changed, server restarted |
| "Invalid account" / 65 ERR_INVALID_ACCOUNT | Wrong login, password or server picked | Account moved, disabled, archived or created on a different server |
| 130 ERR_INVALID_STOPS / 10016 TRADE_RETCODE_INVALID_STOPS | EA places SL/TP too close to price | Stops level or freeze level changed on the symbol, spread widened |
| 136 ERR_OFF_QUOTES / 10021 TRADE_RETCODE_PRICE_OFF | Rare, mostly very old prices in a request | Quotes stopped: LP, bridge or data feed issue, symbol session closed |
| 133 ERR_TRADE_DISABLED / 10017 TRADE_RETCODE_TRADE_DISABLED | Investor (read-only) password used | Trading disabled for the symbol, group or account |
| 10026 TRADE_RETCODE_SERVER_DISABLES_AT | Never; the code itself names the server | Expert Advisor trading disabled in the group or account settings |
| 10027 TRADE_RETCODE_CLIENT_DISABLES_AT / 4109 | Algo Trading button or "Allow live trading" off | Not server-side |
| 134 ERR_NOT_ENOUGH_MONEY / 10019 TRADE_RETCODE_NO_MONEY | Lot too large for free margin | Leverage, margin settings or currency rates in the group are wrong |
| 132 ERR_MARKET_CLOSED / 10018 TRADE_RETCODE_MARKET_CLOSED | Trading outside session hours | Session schedule, DST shift or holiday calendar set incorrectly |
Route tickets the same way: client-side issues get a help-centre answer, server-side issues go to the platform administrator or an outsourced team such as FXSUPPORT MetaTrader support.
Connection errors: "No connection" and "Invalid account"
"No connection" means the terminal cannot reach the trade server address it was given, and "Invalid account" means it reached a server that rejected the login. Each needs different checks, and the broker can see things the trader cannot.
What the trader can check
- Confirm the internet connection works in a browser.
- Re-enter the login, the password and the exact server name. MT5 help notes that you can also type the address manually as "[server number]:[port number], for example, 192.168.0.1:443".
- Check that the password is the master password. MetaQuotes explains that "Investor authorization allows you to see the account status, analyze prices, and work with your own Expert Advisors, but not trade."
- Check the proxy and firewall. In MT5, the Server tab under Tools > Options holds the "setup of server connection, configuration of a proxy server".
- Open the log viewer, filter by "No connection" and send the YYYYMMDD.LOG file to the broker.
What the broker should check on the server side
- Reachability of every access point. Test each address and port published in the server list from outside your own network, and test from more than one region.
- Recent infrastructure changes. New IPs, DNS records, data-centre moves or DDoS-protection rules often cause "No connection" waves.
- Server health. CPU, memory and disk on the trade and access servers. Overload shows up as timeouts (128 ERR_TRADE_TIMEOUT, 10012 TRADE_RETCODE_TIMEOUT) before full disconnects.
- Account state. Is the account enabled? Is it in the right group? Was it moved during a migration? Was a forced password change switched on? MT5 help confirms that "Forced password change can be enabled by the trade server administrator."
- Old client builds. 5 ERR_OLD_VERSION ("Old version of the client terminal") means the terminal needs updating.
For deeper network and host issues, see forex server troubleshooting and MetaTrader server hosting.
MT5 trade server return codes brokers see most
The MT5 codes below are the ones that most often reach a broker's support desk, and several of them name the server as the cause. Names and descriptions are quoted from the MQL5 Reference. The right-hand column shows where we start looking on the server.
| Code | Constant | MetaQuotes description | First server-side check |
|---|---|---|---|
| 10004 | TRADE_RETCODE_REQUOTE | Requote | Execution mode and price deviation settings of the symbol |
| 10006 | TRADE_RETCODE_REJECT | Request rejected | Dealer, gateway or bridge rejection in the server journal |
| 10012 | TRADE_RETCODE_TIMEOUT | Request canceled by timeout | Bridge/LP response time, server load |
| 10014 | TRADE_RETCODE_INVALID_VOLUME | Invalid volume in the request | Symbol min/max/step volume, group volume limits |
| 10016 | TRADE_RETCODE_INVALID_STOPS | Invalid stops in the request | Stops level and freeze level on the symbol |
| 10017 | TRADE_RETCODE_TRADE_DISABLED | Trade is disabled | Symbol trade mode, group symbol permissions, account rights |
| 10018 | TRADE_RETCODE_MARKET_CLOSED | Market is closed | Trading sessions, DST, holiday schedule |
| 10019 | TRADE_RETCODE_NO_MONEY | There is not enough money to complete the request | Group leverage and margin settings |
| 10021 | TRADE_RETCODE_PRICE_OFF | There are no quotes to process the request | Data feed, LP/bridge session, symbol quote sources |
| 10024 | TRADE_RETCODE_TOO_MANY_REQUESTS | Too frequent requests | Request-rate limits; often a looping EA |
| 10026 | TRADE_RETCODE_SERVER_DISABLES_AT | Autotrading disabled by server | Expert Advisor permissions on the group or account |
| 10030 | TRADE_RETCODE_INVALID_FILL | Invalid order filling type | Filling modes allowed on the symbol vs. execution mode |
| 10031 | TRADE_RETCODE_CONNECTION | No connection with the trade server | Access point reachability, server status |
| 10040 | TRADE_RETCODE_LIMIT_POSITIONS | The number of open positions … can be limited by the server settings | Group position limits |
| 10044 | TRADE_RETCODE_CLOSE_ONLY | The request is rejected, because the "Only position closing is allowed" rule is set for the symbol | Symbol trade mode (close-only) |
| 10046 | TRADE_RETCODE_HEDGE_PROHIBITED | … "Opposite positions on a single symbol are disabled" rule is set for the trading account | Group hedging rules |
The full list, including 10009 TRADE_RETCODE_DONE ("Request completed") and 10010 TRADE_RETCODE_DONE_PARTIAL, is on the MQL5 Trade Server Return Codes page.
MT4 error codes and their MT5 equivalents
MT4 trade errors use small numbers that MetaQuotes lists in the MQL4 Reference, and most have a direct MT5 counterpart. Use the mapping below when clients move between platforms or when you run both servers during an MT4 to MT5 migration.
| MT4 code | MT4 constant and description | Closest MT5 code |
|---|---|---|
| 2 | ERR_COMMON_ERROR — Common error | 10011 TRADE_RETCODE_ERROR |
| 4 | ERR_SERVER_BUSY — Trade server is busy | 10012 TRADE_RETCODE_TIMEOUT (by effect) |
| 6 | ERR_NO_CONNECTION — No connection with trade server | 10031 TRADE_RETCODE_CONNECTION |
| 65 | ERR_INVALID_ACCOUNT — Invalid account | Login-time error, no retcode |
| 129 | ERR_INVALID_PRICE — Invalid price | 10015 TRADE_RETCODE_INVALID_PRICE |
| 130 | ERR_INVALID_STOPS — Invalid stops | 10016 TRADE_RETCODE_INVALID_STOPS |
| 131 | ERR_INVALID_TRADE_VOLUME — Invalid trade volume | 10014 TRADE_RETCODE_INVALID_VOLUME |
| 132 | ERR_MARKET_CLOSED — Market is closed | 10018 TRADE_RETCODE_MARKET_CLOSED |
| 133 | ERR_TRADE_DISABLED — Trade is disabled | 10017 TRADE_RETCODE_TRADE_DISABLED |
| 134 | ERR_NOT_ENOUGH_MONEY — Not enough money | 10019 TRADE_RETCODE_NO_MONEY |
| 136 | ERR_OFF_QUOTES — Off quotes | 10021 TRADE_RETCODE_PRICE_OFF |
| 138 | ERR_REQUOTE — Requote | 10004 TRADE_RETCODE_REQUOTE |
| 146 | ERR_TRADE_CONTEXT_BUSY — Trade context is busy | No direct equivalent |
| 149 | ERR_TRADE_HEDGE_PROHIBITED | 10046 TRADE_RETCODE_HEDGE_PROHIBITED |
| 150 | ERR_TRADE_PROHIBITED_BY_FIFO | 10045 TRADE_RETCODE_FIFO_CLOSE |
The mapping is our practical guide, not an official MetaQuotes table. The descriptions themselves are quoted from the MQL4 Trade Server Return Codes page.
Trade context busy (146) is MT4-specific. The MQL4 function IsTradeContextBusy() "returns true if a thread for trading is occupied by another Expert Advisor". It is a client-side issue. Several EAs in one terminal are competing for the trading thread, and the fix is retry logic or fewer EAs per terminal. The broker cannot fix it on the server.
Invalid stops, off quotes and requotes: the configuration errors
Invalid stops, off quotes and requotes look like trader mistakes but are often caused by symbol settings or by the liquidity chain. When they appear across many accounts at once, the broker should treat them as a configuration incident.
Invalid stops (130 / 10016) and modification denied (145)
MetaTrader enforces two distances. The MQL5 Reference defines SYMBOL_TRADE_STOPS_LEVEL as the "Minimal indention in points from the current close price to place Stop orders". It defines SYMBOL_TRADE_FREEZE_LEVEL as the "Distance to freeze trade operations in points". The MQL4 book adds that "Pending orders can not be deleted or modified if the declared open price violates the FreezeLevel parameter requirements". The MT4 error for that case is 145 ERR_TRADE_MODIFY_DENIED: "Modification denied because order is too close to market".
Server-side causes we check:
- A stops level or freeze level was raised (for news or a new LP) without telling clients.
- Floating spreads widened, so a stop that was valid a second ago is now too close.
- Symbol digits changed (for example, after a feed change), so "points" mean something different to existing EAs.
Off quotes (136) and no prices (10021)
MetaQuotes describes 10021 as "There are no quotes to process the request". On a broker server this almost always means the price stream for that symbol stopped or went stale. Typical causes are a disconnected LP session, a bridge restart, a data-feed mapping error after a symbol rename, or a session schedule that closed quoting early. Check feed status and bridge logs first. See bridge solutions and liquidity provider integration.
Requotes (138 / 10004) and price changed (135 / 10020)
Requotes come from instant or request execution, where the server answers with a new price instead of filling. Frequent requotes usually mean the deviation settings are too tight for current volatility or the price source is too slow. Separately, an order can return 10030 TRADE_RETCODE_INVALID_FILL if the filling modes allowed on the symbol (SYMBOL_FILLING_MODE, "Flags of allowed order filling modes") do not match what the client or EA sends.
Errors spreading across accounts?
Send us the error codes and a few journal lines. We will tell you whether the cause is the client, the symbol setup, the server or the liquidity chain, and we will help you fix it.
Request a free technical review WhatsApp TelegramAutotrading and permission errors
Autotrading errors split cleanly by name: 10026 says the server disabled it, and 10027 says the client terminal did. In MT4, the client-side equivalent is runtime error 4109.
10026 — Autotrading disabled by server
The broker has disabled Expert Advisor trading for the account or its group. Fix it in the group or account permissions, or tell the client that EAs are not allowed on that account type.
10027 — Autotrading disabled by client terminal
The Algo Trading button or the EA's own setting is off. The trader enables it. MQL5 runtime error 4752 ERR_TRADE_DISABLED ("Trading by Expert Advisors prohibited") has the same meaning inside the code.
4109 — ERR_TRADE_NOT_ALLOWED (MT4)
MetaQuotes' description says it plainly: "Trade is not allowed. Enable checkbox "Allow live trading" in the Expert Advisor properties". This is client-side.
133 / 10017 — Trade is disabled
The symbol is view-only or close-only, the group lacks permission for that symbol, or the client logged in with the investor password.
Plugins can also block or rewrite requests. A risk or routing plugin that rejects orders shows up to the client as a generic rejection (10006) or common error (2). If rejections started after a plugin update, check that plugin first. We build and maintain these as part of MetaTrader plugin development.
A broker's server-side checklist for recurring errors
When the same error keeps coming back, work through the server in a fixed order: scope, logs, recent changes, then configuration. That order separates a configuration problem from an infrastructure problem within the first few checks.
- Scope. Is it one account, one group, one symbol or all users? Is it MT4, MT5 or both? Is it one access point or every one?
- Collect the exact code. Ask for the retcode or error number and the timestamp. Do not work from screenshots of popup messages alone.
- Read the server journal for the same timestamp. Match the client request to the server-side entry (dealer, gateway, plugin or bridge).
- List recent changes. Platform updates, symbol or group edits, new plugins, LP or bridge changes, IP/DNS or firewall rules, DST switches.
- Check the symbol. Trade mode, sessions, stops and freeze levels, volume limits, filling modes, execution mode, quote source.
- Check the group and account. Leverage, margin settings, EA permissions, hedging/FIFO rules, position limits, account enabled.
- Check the liquidity chain. Bridge status, LP sessions, rejected and timed-out orders in the bridge logs.
- Check the infrastructure. CPU, memory, disk, network latency between servers, and backups and database integrity after any crash.
- Fix, then monitor. Track the error rate after the change, not just the single ticket.
This is the same process FXSUPPORT uses for broker clients. It is part of our MetaTrader administration and risk operations work, which includes session and DST/holiday schedule checks.
From firefighting to monitoring
Most recurring MetaTrader errors can be detected in the server logs before clients complain. You get there by watching error rates instead of single tickets. A rise in 10021 on one symbol, timeouts during one session, or rejects after a bridge restart are all visible in logs minutes after they start.
FXSUPPORT provides MT4/MT5 platform support for brokers and prop firms: setup, updates, backups, configuration, log monitoring and bridge configuration. We also cover server infrastructure in the UK and the Netherlands with monitoring and a 99.9% uptime target. In practice, that means we:
- watch platform and bridge logs for error patterns, not only outages;
- review symbol, session and group settings after every change and before DST switches;
- check plugin behaviour after platform updates;
- harden servers against DDoS and keep backups restorable.
If you run a brokerage and your support team spends its days answering the same error tickets, that is a sign the cause sits on the server. See MT5 support and MT4 support for what we cover, or contact us for a free technical review.
Frequently asked questions
What are the most common MetaTrader errors?
Where can I find the official list of MT5 error codes?
Do MT4 and MT5 use the same error numbers?
What does "No connection" mean in MT4 or MT5?
Why does MetaTrader say "Invalid account" when my password is correct?
What is TRADE_RETCODE_PRICE_OFF (10021)?
How do I fix invalid stops (130 or 10016)?
What is the difference between 10026 and 10027?
Why does an order return "done" but no position opens?
What does "Trade context is busy" (146) mean?
Where are MetaTrader log files stored?
When should a broker outsource MetaTrader error handling?
Is FXSUPPORT part of MetaQuotes?
Sources
- Trade Server Return Codes — MQL5 Reference, MetaQuotes (accessed 8 October 2026)
- Runtime Errors — MQL5 Reference, MetaQuotes (accessed 8 October 2026)
- Trade Server Return Codes — MQL4 Reference, MetaQuotes (accessed 8 October 2026)
- Runtime Errors — MQL4 Reference, MetaQuotes (accessed 8 October 2026)
- IsTradeContextBusy — MQL4 Reference, MetaQuotes (accessed 8 October 2026)
- OrderSend — MQL5 Reference, MetaQuotes (accessed 8 October 2026)
- Symbol Properties — MQL5 Reference, MetaQuotes (accessed 8 October 2026)
- Requirements and Limitations in Making Trades — MQL4 Book, MetaQuotes (accessed 8 October 2026)
- Connect to an Account — MetaTrader 5 Help, MetaQuotes (accessed 8 October 2026)
- Platform Logs — MetaTrader 5 Help, MetaQuotes (accessed 8 October 2026)
- Platform Settings — MetaTrader 5 Help, MetaQuotes (accessed 8 October 2026)
FXSUPPORT is not affiliated with MetaQuotes Ltd. or the vendors named on this page. General information, not legal or investment advice.
Seeing the same errors across many accounts?
Send us the codes and a few log lines. We review your MT4/MT5 server setup and tell you where the errors come from.