MT5 error codes
What each MetaTrader 5 return code means when a trade fails, and how to fix it.
When a trade fails, the Trade Queue shows the code your broker returned:
OrderSend failed: 10016 - Invalid stopsThe number is the code. The text after it is your broker's own comment, which varies between brokers. Find the code below.
Three kinds of code
MetaTrader uses separate numbering schemes that overlap, so the same number can mean different things depending on where it appeared.
| Range | Source | Where you see it |
|---|---|---|
| 10xxx | Trade server return codes | OrderSend failed: ... in the Trade Queue |
| 4xxx | MQL5 runtime errors | The Experts tab in MT5 |
| Text | NexumTrader's own messages | The Trade Queue, with no number |
The overlap is real. 10004 is a requote when it comes from a trade request, but the VPS bridge uses the same number for a failed server connection during login. Match the code to where you saw it.
For NexumTrader's own messages, such as timeouts and dashboard mismatches, see Troubleshooting.
Connection
4014: WebRequest not allowed
You will see: The account shows offline, and MT5's Experts tab logs Error: 4014. Signals still land in the Trade Queue, since the dashboard has no way to know the EA is blocked, but the EA never polls for them, so they time out as Trade timed out (not picked up within 5 seconds).
Cause: The EA calls WebRequest, which MT5 blocks unless the URL is on the terminal's allowlist.
Fix: In MT5, open Tools, Options, Expert Advisors. Tick Allow WebRequest for listed URL and add https://api.nexumtrader.com. Click OK and restart the EA.
In NexumTrader: EA versions before 1.6.8 used a different host, so an EA that worked previously will fail here after upgrading. Re-add the URL above.
Order rejected by the broker
10004: Requote
You will see: OrderSend failed: 10004
Cause: The price moved between the EA requesting a price and the broker filling it.
Fix: Usually self-resolves on the next signal. If it is constant, your broker's execution is slow for that symbol, or the market is unusually volatile.
In NexumTrader: Nothing to configure. The signal is marked failed and no position is opened.
10006: Request rejected
You will see: OrderSend failed: 10006
Cause: The broker rejected the order without giving a specific reason.
Fix: Read the broker comment shown after the code, which is the only detail available. Check whether the account is read-only or restricted.
In NexumTrader: Common on prop firm accounts that block trading outside a permitted window or after a drawdown breach.
10013: Invalid request
You will see: OrderSend failed: 10013
Cause: The broker considered the request itself malformed, usually an unknown symbol or an unsupported order type.
Fix: Confirm the symbol name in your alert matches the broker's exactly, including any suffix such as EURUSD.pro.
In NexumTrader: Symbol suffixes are the usual cause. Your alert must send the name your broker uses, not the TradingView name.
10014: Invalid volume
You will see: OrderSend failed: 10014
Cause: The lot size is below the broker's minimum, above its maximum, or not a multiple of its lot step.
Fix: Check Symbol, Specification in MT5 for minimum, maximum and step volume.
In NexumTrader: Lot size is derived from Risk% and stop distance. A very small account with a wide stop can compute a lot below the minimum. Raise Risk% or narrow the stop distance.
10015: Invalid price
You will see: OrderSend failed: 10015
Cause: The requested price is not valid for this symbol, typically on a pending order placed on the wrong side of the market.
Fix: Check the entry price in your alert against the current market price.
In NexumTrader: Market orders take the current price, so this points at an absolute price in the alert payload.
10016: Invalid stops
You will see: OrderSend failed: 10016 - Invalid stops
Cause: The stop loss or take profit sits inside the broker's minimum stop distance, or on the wrong side of the entry price.
Fix: Widen the SL and TP distance. Check Symbol, Specification, Stops Level in MT5 for the minimum your broker enforces.
In NexumTrader: The most common cause is a tight stop on an indices or metals symbol, where brokers set a wide stops level. Modifying SL/TP on an open position hits the same broker rule, but you will not see this number there. Instead the Trade Queue shows Broker rejected SL/TP modification: invalid SL/TP, too close to price or on the wrong side (broker stops level).
10017: Trading disabled
You will see: OrderSend failed: 10017
Cause: The broker has disabled trading for this symbol or this account.
Fix: Check whether the symbol is tradeable at your broker right now, and whether the account is investor (read-only) rather than trading.
In NexumTrader: An investor password grants read-only access. The EA connects and appears online, but every trade fails with this code.
10018: Market closed
You will see: OrderSend failed: 10018
Cause: The symbol's trading session is closed.
Fix: Wait for the session to open. Check the broker's session hours under Symbol, Specification, Sessions.
In NexumTrader: Use Trading Windows to stop sending signals outside market hours, so these never reach the broker.
10019: Not enough money
You will see: OrderSend failed: 10019
Cause: Free margin is insufficient for the requested lot size.
Fix: Lower Risk% on the account, close other positions, or fund the account.
In NexumTrader: On a multi-account setup, check whether earlier accounts in the fan-out consumed the margin first.
10020: Price changed
You will see: OrderSend failed: 10020
Cause: The price changed between request and execution. Closely related to a requote.
Fix: Usually self-resolves. Persistent occurrences suggest high latency between your VPS and the broker.
In NexumTrader: Nothing to configure.
10021: No quotes
You will see: OrderSend failed: 10021
Cause: The broker has no live prices for the symbol.
Fix: Add the symbol to Market Watch in MT5 and confirm prices are ticking. Check your terminal's connection status.
In NexumTrader: A symbol absent from Market Watch is the usual cause. MT5 does not always subscribe to a symbol automatically.
10022: Invalid expiration
You will see: OrderSend failed: 10022
Cause: The order's expiration time is invalid or unsupported by the broker.
Fix: Remove the expiration from the alert, or set it further into the future.
In NexumTrader: Rare, since market orders carry no expiration.
AutoTrading and filling
10026: AutoTrading disabled by server
You will see: OrderSend failed: 10026
Cause: The broker has disabled automated trading on the account, server side. You cannot override this from the terminal.
Fix: Contact the broker and ask for EA trading to be enabled.
In NexumTrader: Some prop firm evaluation accounts forbid EAs outright. Confirm your firm's rules before troubleshooting further.
10027: AutoTrading disabled by client
You will see: OrderSend failed: 10027
Cause: The AutoTrading button in the MT5 toolbar is off.
Fix: Click AutoTrading in the toolbar so it turns green. Confirm the EA's chart shows a smiling face, not a sad one.
In NexumTrader: This is a common day-one failure. The EA connects and shows online, because polling uses WebRequest rather than trading permissions, so everything looks correct until the first signal fails.
10030: Unsupported filling mode
You will see: OrderSend failed: 10030
Cause: The broker does not accept the order filling mode the EA requested.
Fix: Usually handled automatically. See the note below if it persists.
In NexumTrader: The EA already retries this one. On a symbol that supports it, the EA requests Fill or Kill first, and on 10030 it retries with Fill or Kill again, then falls back to Return, before giving up. Seeing 10030 in the Trade Queue means all three attempts were rejected, which points at a broker restriction on the symbol rather than a configuration problem.
10034: Volume limit reached
You will see: OrderSend failed: 10034
Cause: The order would exceed the broker's total volume limit for the symbol or account.
Fix: Reduce lot size, or close existing positions on that symbol.
In NexumTrader: On a multi-account fan-out, the limit applies per account, so check the specific account named in the failed row.
Still stuck
If your code is not listed, the Trade Queue still shows the raw number and your broker's comment. Send both to support@nexumtrader.com and we will add it here.