Home About Services IT Infrastructure Platform Support Risk Operations CRM & Plugin Development Licensing & Corporate Infrastructure Contact
English Türkçe Español Français Deutsch Português 中文 العربية Русский 日本語
Troubleshooting

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.

Short answer: MetaTrader common errors fall into two groups. Client-side errors (wrong login, no internet, Algo Trading off, bad lot size or stop distance in an EA) are fixed by the trader. Server-side errors such as "No connection", "Off quotes", 10021 TRADE_RETCODE_PRICE_OFF or 10026 "Autotrading disabled by server" usually need the broker to check the MT4/MT5 server, symbol settings and liquidity feed.

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.

Who usually owns the fix for common MetaTrader errors
Symptom or codeUsually client-side when…Usually server-side when…
"No connection" / 6 ERR_NO_CONNECTION / 10031 TRADE_RETCODE_CONNECTIONOne user, local internet, firewall, proxy or wrong server nameMany users at once, access point down, IP or DNS changed, server restarted
"Invalid account" / 65 ERR_INVALID_ACCOUNTWrong login, password or server pickedAccount moved, disabled, archived or created on a different server
130 ERR_INVALID_STOPS / 10016 TRADE_RETCODE_INVALID_STOPSEA places SL/TP too close to priceStops level or freeze level changed on the symbol, spread widened
136 ERR_OFF_QUOTES / 10021 TRADE_RETCODE_PRICE_OFFRare, mostly very old prices in a requestQuotes stopped: LP, bridge or data feed issue, symbol session closed
133 ERR_TRADE_DISABLED / 10017 TRADE_RETCODE_TRADE_DISABLEDInvestor (read-only) password usedTrading disabled for the symbol, group or account
10026 TRADE_RETCODE_SERVER_DISABLES_ATNever; the code itself names the serverExpert Advisor trading disabled in the group or account settings
10027 TRADE_RETCODE_CLIENT_DISABLES_AT / 4109Algo Trading button or "Allow live trading" offNot server-side
134 ERR_NOT_ENOUGH_MONEY / 10019 TRADE_RETCODE_NO_MONEYLot too large for free marginLeverage, margin settings or currency rates in the group are wrong
132 ERR_MARKET_CLOSED / 10018 TRADE_RETCODE_MARKET_CLOSEDTrading outside session hoursSession 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

  1. Confirm the internet connection works in a browser.
  2. 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".
  3. 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."
  4. Check the proxy and firewall. In MT5, the Server tab under Tools > Options holds the "setup of server connection, configuration of a proxy server".
  5. 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.

Selected MT5 trade server return codes (MQL5 Reference, accessed October 2026)
CodeConstantMetaQuotes descriptionFirst server-side check
10004TRADE_RETCODE_REQUOTERequoteExecution mode and price deviation settings of the symbol
10006TRADE_RETCODE_REJECTRequest rejectedDealer, gateway or bridge rejection in the server journal
10012TRADE_RETCODE_TIMEOUTRequest canceled by timeoutBridge/LP response time, server load
10014TRADE_RETCODE_INVALID_VOLUMEInvalid volume in the requestSymbol min/max/step volume, group volume limits
10016TRADE_RETCODE_INVALID_STOPSInvalid stops in the requestStops level and freeze level on the symbol
10017TRADE_RETCODE_TRADE_DISABLEDTrade is disabledSymbol trade mode, group symbol permissions, account rights
10018TRADE_RETCODE_MARKET_CLOSEDMarket is closedTrading sessions, DST, holiday schedule
10019TRADE_RETCODE_NO_MONEYThere is not enough money to complete the requestGroup leverage and margin settings
10021TRADE_RETCODE_PRICE_OFFThere are no quotes to process the requestData feed, LP/bridge session, symbol quote sources
10024TRADE_RETCODE_TOO_MANY_REQUESTSToo frequent requestsRequest-rate limits; often a looping EA
10026TRADE_RETCODE_SERVER_DISABLES_ATAutotrading disabled by serverExpert Advisor permissions on the group or account
10030TRADE_RETCODE_INVALID_FILLInvalid order filling typeFilling modes allowed on the symbol vs. execution mode
10031TRADE_RETCODE_CONNECTIONNo connection with the trade serverAccess point reachability, server status
10040TRADE_RETCODE_LIMIT_POSITIONSThe number of open positions … can be limited by the server settingsGroup position limits
10044TRADE_RETCODE_CLOSE_ONLYThe request is rejected, because the "Only position closing is allowed" rule is set for the symbolSymbol trade mode (close-only)
10046TRADE_RETCODE_HEDGE_PROHIBITED… "Opposite positions on a single symbol are disabled" rule is set for the trading accountGroup 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 error codes (MQL4 Reference) and the closest MT5 return code
MT4 codeMT4 constant and descriptionClosest MT5 code
2ERR_COMMON_ERROR — Common error10011 TRADE_RETCODE_ERROR
4ERR_SERVER_BUSY — Trade server is busy10012 TRADE_RETCODE_TIMEOUT (by effect)
6ERR_NO_CONNECTION — No connection with trade server10031 TRADE_RETCODE_CONNECTION
65ERR_INVALID_ACCOUNT — Invalid accountLogin-time error, no retcode
129ERR_INVALID_PRICE — Invalid price10015 TRADE_RETCODE_INVALID_PRICE
130ERR_INVALID_STOPS — Invalid stops10016 TRADE_RETCODE_INVALID_STOPS
131ERR_INVALID_TRADE_VOLUME — Invalid trade volume10014 TRADE_RETCODE_INVALID_VOLUME
132ERR_MARKET_CLOSED — Market is closed10018 TRADE_RETCODE_MARKET_CLOSED
133ERR_TRADE_DISABLED — Trade is disabled10017 TRADE_RETCODE_TRADE_DISABLED
134ERR_NOT_ENOUGH_MONEY — Not enough money10019 TRADE_RETCODE_NO_MONEY
136ERR_OFF_QUOTES — Off quotes10021 TRADE_RETCODE_PRICE_OFF
138ERR_REQUOTE — Requote10004 TRADE_RETCODE_REQUOTE
146ERR_TRADE_CONTEXT_BUSY — Trade context is busyNo direct equivalent
149ERR_TRADE_HEDGE_PROHIBITED10046 TRADE_RETCODE_HEDGE_PROHIBITED
150ERR_TRADE_PROHIBITED_BY_FIFO10045 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 Telegram

Autotrading 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.

  1. 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?
  2. Collect the exact code. Ask for the retcode or error number and the timestamp. Do not work from screenshots of popup messages alone.
  3. Read the server journal for the same timestamp. Match the client request to the server-side entry (dealer, gateway, plugin or bridge).
  4. List recent changes. Platform updates, symbol or group edits, new plugins, LP or bridge changes, IP/DNS or firewall rules, DST switches.
  5. Check the symbol. Trade mode, sessions, stops and freeze levels, volume limits, filling modes, execution mode, quote source.
  6. Check the group and account. Leverage, margin settings, EA permissions, hedging/FIFO rules, position limits, account enabled.
  7. Check the liquidity chain. Bridge status, LP sessions, rejected and timed-out orders in the bridge logs.
  8. Check the infrastructure. CPU, memory, disk, network latency between servers, and backups and database integrity after any crash.
  9. 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?
The errors traders report most are "No connection", "Invalid account", invalid stops (130 / 10016), off quotes or no prices (136 / 10021), not enough money (134 / 10019), market closed (132 / 10018), trade disabled (133 / 10017) and autotrading disabled (10026 / 10027). In MT4, trade context busy (146) is also frequent among EA users.
Where can I find the official list of MT5 error codes?
MetaQuotes publishes them in the MQL5 Reference under "Codes of Errors and Warnings". Trade server return codes (10004–10046) are on the Trade Server Return Codes page. Program runtime errors (from 4001 in MQL5) are on the Runtime Errors page.
Do MT4 and MT5 use the same error numbers?
No. MT4 uses small numbers such as 130 ERR_INVALID_STOPS, while MT5 uses 10000-range return codes such as 10016 TRADE_RETCODE_INVALID_STOPS. Most MT4 trade errors have a close MT5 equivalent, but a few, such as 146 Trade context is busy, do not.
What does "No connection" mean in MT4 or MT5?
The terminal cannot reach the trade server address it is using. If only one user is affected, check the internet, firewall, proxy and server name. If many users are affected at once, the broker should check access-point reachability, recent IP or DNS changes, and server health.
Why does MetaTrader say "Invalid account" when my password is correct?
The login may be on a different server from the one selected, or the account may be disabled, archived or moved. Some servers also force a password change. MetaQuotes confirms that forced password change "can be enabled by the trade server administrator". Contact the broker if the server name is correct.
What is TRADE_RETCODE_PRICE_OFF (10021)?
MetaQuotes describes it as "There are no quotes to process the request". On a broker server it usually means quotes for that symbol stopped or went stale, often because of a liquidity provider, bridge or data-feed problem, or a closed session.
How do I fix invalid stops (130 or 10016)?
Place the stop loss and take profit further from the current price than the symbol's stops level, and do not modify orders inside the freeze level. If many clients get it suddenly, the broker should check whether the stops or freeze level, the spread or the symbol digits changed.
What is the difference between 10026 and 10027?
10026 TRADE_RETCODE_SERVER_DISABLES_AT means autotrading was disabled by the server, so the broker's group or account settings block Expert Advisors. 10027 TRADE_RETCODE_CLIENT_DISABLES_AT means it was disabled in the client terminal, and the trader must enable Algo Trading.
Why does an order return "done" but no position opens?
MetaQuotes notes that a successful OrderSend() result "does not mean that the order has been executed", only that the request was accepted. The order can still be rejected later by a dealer, gateway, bridge or plugin. Check the server journal for the same timestamp.
What does "Trade context is busy" (146) mean?
It is an MT4 error that appears when another Expert Advisor is using the terminal's trading thread. It is fixed in the EA code with retry logic, or by running fewer EAs per terminal. It is not a server problem.
Where are MetaTrader log files stored?
In MT5, platform logs are in the Logs directory and Expert logs are in MQL5\Logs. Files are named by date as YYYYMMDD.LOG. Send these files to the broker with the exact time of the error.
When should a broker outsource MetaTrader error handling?
Consider outsourcing when the same errors recur across accounts, when nobody in-house can read the server and bridge logs, or when issues appear outside office hours. FXSUPPORT offers MT4/MT5 platform support with log monitoring. You can start with a free technical review via the contact form.
Is FXSUPPORT part of MetaQuotes?
No. FXSUPPORT is an independent technical support provider for brokers and is not affiliated with MetaQuotes Ltd. Error names and descriptions on this page are quoted from MetaQuotes' public documentation.

Sources

  1. Trade Server Return Codes — MQL5 Reference, MetaQuotes (accessed 8 October 2026)
  2. Runtime Errors — MQL5 Reference, MetaQuotes (accessed 8 October 2026)
  3. Trade Server Return Codes — MQL4 Reference, MetaQuotes (accessed 8 October 2026)
  4. Runtime Errors — MQL4 Reference, MetaQuotes (accessed 8 October 2026)
  5. IsTradeContextBusy — MQL4 Reference, MetaQuotes (accessed 8 October 2026)
  6. OrderSend — MQL5 Reference, MetaQuotes (accessed 8 October 2026)
  7. Symbol Properties — MQL5 Reference, MetaQuotes (accessed 8 October 2026)
  8. Requirements and Limitations in Making Trades — MQL4 Book, MetaQuotes (accessed 8 October 2026)
  9. Connect to an Account — MetaTrader 5 Help, MetaQuotes (accessed 8 October 2026)
  10. Platform Logs — MetaTrader 5 Help, MetaQuotes (accessed 8 October 2026)
  11. 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.