New: the free EA code check shows the first issue with its fix →
Trading Checkup

Trading error code explainer: MT5, Binance, Bybit and OKX

Paste the error your EA or bot got. You get what it means in plain words, the likely causes (most common first), how to fix it, and the official source with the date we read it. If a code is not in the platform's official list, we say so: we never guess. Free, and it runs in your browser, so nothing you paste is sent to us.

For example 10016, TRADE_RETCODE_INVALID_FILL, OrderSend error 4756, -2010, retCode 110007 or sCode 51121. Remove API keys before you paste.

Or try an example:

What it covers

2,368 official error codes and messages: MetaTrader 5 trade server return codes (MqlTradeResult.retcode) and MQL5 runtime errors (GetLastError), Binance spot and USDS-M futures error codes with filter failures and -2010 messages, Bybit v5 retCodes and OKX v5 codes and sCodes. 276 of them have a detailed write-up with ranked causes and fix steps; the rest show the official meaning with general fix steps. Where a code example helps, it is short and tested: the MQL5 ones compile in MetaEditor with 0 errors, the Python ones run.

MetaTrader 5 / MQL5: 56 codes explained in detail (of 296 official codes searchable above)
Source: https://www.mql5.com/en/docs/constants/errorswarnings/enum_trade_return_codes , https://www.mql5.com/en/docs/constants/errorswarnings/errorcodes, read 2026-11-28
CodeNameMeaning
10004TRADE_RETCODE_REQUOTERequote: the broker offers a new price because the price moved before your market order was filled.
10006TRADE_RETCODE_REJECTThe trade server rejected the request.
10007TRADE_RETCODE_CANCELThe request was cancelled by the trader (not an error from your code logic).
10008TRADE_RETCODE_PLACEDSuccess: the pending order was placed.
10009TRADE_RETCODE_DONESuccess: the request was completed (the deal or change was done).
10010TRADE_RETCODE_DONE_PARTIALOnly part of the request was done (partial fill).
10011TRADE_RETCODE_ERRORRequest processing error on the server side.
10012TRADE_RETCODE_TIMEOUTThe request timed out; its final result is not known yet.
10013TRADE_RETCODE_INVALIDInvalid request: one or more fields of MqlTradeRequest are wrong or missing.
10014TRADE_RETCODE_INVALID_VOLUMEInvalid volume: the lot size is below the minimum, above the maximum, or not a multiple of the volume step. Step-by-step fix
10015TRADE_RETCODE_INVALID_PRICEInvalid price in the request.
10016TRADE_RETCODE_INVALID_STOPSInvalid stops: the stop loss or take profit is too close to the price, on the wrong side, or not normalized. Step-by-step fix
10017TRADE_RETCODE_TRADE_DISABLEDTrading is disabled for this symbol or account.
10018TRADE_RETCODE_MARKET_CLOSEDThe market is closed for this symbol right now.
10019TRADE_RETCODE_NO_MONEYNot enough money (free margin) to open this trade.
10020TRADE_RETCODE_PRICE_CHANGEDPrices changed while the request was processed.
10021TRADE_RETCODE_PRICE_OFFNo quotes to process the request (off quotes).
10022TRADE_RETCODE_INVALID_EXPIRATIONInvalid order expiration date in the request.
10023TRADE_RETCODE_ORDER_CHANGEDThe order state changed while your request was processed.
10024TRADE_RETCODE_TOO_MANY_REQUESTSToo frequent requests: you are sending trade requests too fast.
10025TRADE_RETCODE_NO_CHANGESNo changes in the request: the modification has the same values as now.
10026TRADE_RETCODE_SERVER_DISABLES_ATAutotrading is disabled by the server for this account.
10027TRADE_RETCODE_CLIENT_DISABLES_ATAutotrading is disabled in your terminal (the Algo Trading button is off).
10028TRADE_RETCODE_LOCKEDThe request is locked for processing (another request is being handled).
10029TRADE_RETCODE_FROZENThe order or position is frozen and cannot be changed right now.
10030TRADE_RETCODE_INVALID_FILLInvalid (unsupported) order filling type for this symbol. Step-by-step fix
10031TRADE_RETCODE_CONNECTIONNo connection with the trade server.
10032TRADE_RETCODE_ONLY_REALThis operation is allowed only for live (real) accounts.
10033TRADE_RETCODE_LIMIT_ORDERSThe limit on the number of pending orders has been reached.
10034TRADE_RETCODE_LIMIT_VOLUMEThe volume limit for this symbol has been reached (orders + positions).
10035TRADE_RETCODE_INVALID_ORDERIncorrect or prohibited order type.
10036TRADE_RETCODE_POSITION_CLOSEDThe position with this ticket is already closed.
10038TRADE_RETCODE_INVALID_CLOSE_VOLUMEThe close volume is larger than the current position volume.
10039TRADE_RETCODE_CLOSE_ORDER_EXISTA close order already exists for this position.
10040TRADE_RETCODE_LIMIT_POSITIONSThe number of open positions reached the account limit.
10041TRADE_RETCODE_REJECT_CANCELThe pending order activation request was rejected and the order was cancelled.
10042TRADE_RETCODE_LONG_ONLYOnly long (buy) positions are allowed for this symbol.
10043TRADE_RETCODE_SHORT_ONLYOnly short (sell) positions are allowed for this symbol.
10044TRADE_RETCODE_CLOSE_ONLYOnly closing existing positions is allowed for this symbol.
10045TRADE_RETCODE_FIFO_CLOSEPositions must be closed in FIFO order on this account (oldest first).
10046TRADE_RETCODE_HEDGE_PROHIBITEDOpposite positions on one symbol are not allowed on this account (no hedging).
4001ERR_INTERNAL_ERRORUnexpected internal error in the terminal.
4003ERR_INVALID_PARAMETERWrong parameter when calling a system function.
4014ERR_FUNCTION_NOT_ALLOWEDThe function is not allowed to be called here.
4024ERR_INVALID_HANDLEInvalid handle.
4301ERR_MARKET_UNKNOWN_SYMBOLUnknown symbol: the symbol name does not exist on this broker.
4302ERR_MARKET_NOT_SELECTEDThe symbol is not selected in Market Watch.
4752ERR_TRADE_DISABLEDTrading by Expert Advisors is prohibited (algo trading is off for this EA or terminal).
4753ERR_TRADE_POSITION_NOT_FOUNDPosition not found.
4754ERR_TRADE_ORDER_NOT_FOUNDOrder not found.
4755ERR_TRADE_DEAL_NOT_FOUNDDeal not found.
4756ERR_TRADE_SEND_FAILEDTrade request sending failed (OrderSend returned false). The real reason is in MqlTradeResult.retcode.
4758ERR_TRADE_CALC_FAILEDFailed to calculate profit or margin.
4802ERR_INDICATOR_CANNOT_CREATEThe indicator cannot be created.
4806ERR_INDICATOR_DATA_NOT_FOUNDRequested indicator data not found (often: data not ready yet).
4807ERR_INDICATOR_WRONG_HANDLEWrong indicator handle.
Binance (spot + USDS-M futures): 87 codes explained in detail (of 312 official codes searchable above)
Source: https://github.com/binance/binance-spot-api-docs/blob/master/errors.md , https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code, read 2026-11-28
CodeNameMeaning
-1000UNKNOWNUnknown error on Binance's side while processing the request.
-1001DISCONNECTEDInternal error: Binance could not process the request (disconnected).
-1002UNAUTHORIZEDNot authorized for this request.
-1003TOO_MANY_REQUESTSToo many requests: you used more request weight than allowed (repeated abuse leads to an IP ban, HTTP 418).
-1006UNEXPECTED_RESPUnexpected response from the message bus: the order's status is unknown.
-1007TIMEOUTTimeout waiting for the backend: the order may or may not have been executed.
-1008SERVER_BUSYServer busy / request throttled: Binance is overloaded and is refusing requests for now.
-1013INVALID_MESSAGEInvalid message: the order was rejected before matching, usually because it failed a symbol filter (price, quantity or notional).
-1014UNKNOWN_ORDER_COMPOSITIONUnsupported order combination.
-1015TOO_MANY_ORDERSToo many new orders in the current time window.
-1016SERVICE_SHUTTING_DOWNThis service is no longer available.
-1020UNSUPPORTED_OPERATIONThis operation is not supported.
-1021INVALID_TIMESTAMPTimestamp outside recvWindow: your computer's clock and Binance's server time differ too much.
-1022INVALID_SIGNATUREInvalid signature: the HMAC/RSA/Ed25519 signature does not match the request.
-1100ILLEGAL_CHARSIllegal characters in a parameter.
-1101TOO_MANY_PARAMETERSToo many parameters, or a duplicate parameter, were sent.
-1102MANDATORY_PARAM_EMPTY_OR_MALFORMEDA mandatory parameter was not sent, was empty, or was malformed.
-1103UNKNOWN_PARAMAn unknown parameter was sent.
-1104UNREAD_PARAMETERSNot all sent parameters were read.
-1105PARAM_EMPTYA parameter was empty.
-1106PARAM_NOT_REQUIREDA parameter was sent when not required.
-1111BAD_PRECISIONBad precision: price or quantity has more decimals than the symbol allows. Step-by-step fix
-1112NO_DEPTHNo orders on the book for this symbol.
-1114TIF_NOT_REQUIREDtimeInForce was sent when not required.
-1115INVALID_TIFInvalid timeInForce.
-1116INVALID_ORDER_TYPEInvalid order type.
-1117INVALID_SIDEInvalid side.
-1121BAD_SYMBOLInvalid symbol: the symbol does not exist on this market.
-1122INVALID_SYMBOLSTATUSInvalid symbol status (the symbol is not trading now).
-1125INVALID_LISTEN_KEYThe listenKey does not exist (user data stream expired).
-1127MORE_THAN_XX_HOURSLookup interval is too big.
-1128OPTIONAL_PARAMS_BAD_COMBOCombination of optional parameters is invalid.
-1130INVALID_PARAMETERInvalid data sent for a parameter.
-2010NEW_ORDER_REJECTEDNew order rejected by the matching engine; the 'msg' says why (most often insufficient balance).
-2011CANCEL_REJECTEDCancel rejected (often: the order is already filled, cancelled or unknown).
-2013NO_SUCH_ORDEROrder does not exist.
-2014BAD_API_KEY_FMTAPI key format invalid.
-2015REJECTED_MBX_KEYInvalid API key, IP, or permissions for this action.
PRICE_FILTERFilter failure: PRICE_FILTERFilter failure PRICE_FILTER: price is too high, too low, or not a multiple of tickSize. Step-by-step fix
PERCENT_PRICEFilter failure: PERCENT_PRICEFilter failure PERCENT_PRICE: price is too far from the recent average price.
PERCENT_PRICE_BY_SIDEFilter failure: PERCENT_PRICE_BY_SIDEFilter failure PERCENT_PRICE_BY_SIDE: price is too far from the average price for this side.
LOT_SIZEFilter failure: LOT_SIZEFilter failure LOT_SIZE: quantity is below minQty, above maxQty, or not a multiple of stepSize. Step-by-step fix
MIN_NOTIONALFilter failure: MIN_NOTIONALFilter failure MIN_NOTIONAL: price x quantity is below the symbol's minimum order value. Step-by-step fix
NOTIONALFilter failure: NOTIONALFilter failure NOTIONAL: price x quantity is outside the symbol's minNotional..maxNotional range. Step-by-step fix
ICEBERG_PARTSFilter failure: ICEBERG_PARTSFilter failure ICEBERG_PARTS: the iceberg order would split into too many parts.
MARKET_LOT_SIZEFilter failure: MARKET_LOT_SIZEFilter failure MARKET_LOT_SIZE: market order quantity is too high, too low, or off the step.
MAX_POSITIONFilter failure: MAX_POSITIONFilter failure MAX_POSITION: the account position on this symbol would exceed the limit.
MAX_NUM_ORDERSFilter failure: MAX_NUM_ORDERSFilter failure MAX_NUM_ORDERS: too many open orders on this symbol.
MAX_NUM_ALGO_ORDERSFilter failure: MAX_NUM_ALGO_ORDERSFilter failure MAX_NUM_ALGO_ORDERS: too many open stop-loss / take-profit orders on the symbol.
TRAILING_DELTAFilter failure: TRAILING_DELTAFilter failure TRAILING_DELTA: trailingDelta is outside the allowed range.
EXCHANGE_MAX_NUM_ORDERSFilter failure: EXCHANGE_MAX_NUM_ORDERSFilter failure EXCHANGE_MAX_NUM_ORDERS: too many open orders on the account across the exchange.
EXCHANGE_MAX_NUM_ALGO_ORDERSFilter failure: EXCHANGE_MAX_NUM_ALGO_ORDERSFilter failure EXCHANGE_MAX_NUM_ALGO_ORDERS: too many open stop/take-profit orders on the account.
-1099 (futures)NOT_FOUNDNot found, unauthenticated, or unauthorized.
-2018 (futures)BALANCE_NOT_SUFFICIENTBalance is insufficient (futures).
-2019 (futures)MARGIN_NOT_SUFFICIENMargin is insufficient (futures): not enough available margin for this order at your leverage.
-2020 (futures)UNABLE_TO_FILLUnable to fill (futures): the order could not be filled as requested.
-2024 (futures)POSITION_NOT_SUFFICIENTPosition is not sufficient (futures).
-2025 (futures)MAX_OPEN_ORDER_EXCEEDEDMaximum number of open orders reached (futures).
-2027 (futures)MAX_LEVERAGE_RATIOExceeded the maximum allowable position at the current leverage (futures).
-2028 (futures)MIN_LEVERAGE_RATIOLeverage is smaller than permitted: insufficient margin balance (futures).
-4003 (futures)QTY_LESS_THAN_ZEROQuantity less than or equal to zero (futures).
-4004 (futures)QTY_LESS_THAN_MIN_QTYQuantity less than the minimum quantity (futures).
-4005 (futures)QTY_GREATER_THAN_MAX_QTYQuantity greater than the maximum quantity (futures).
-4013 (futures)PRICE_LESS_THAN_MIN_PRICEPrice less than the minimum price (futures).
-4014 (futures)PRICE_NOT_INCREASED_BY_TICK_SIZEPrice not increased by tick size (futures): price is not a multiple of tickSize.
-4015 (futures)INVALID_CL_ORD_ID_LENClient order id is not valid (futures; max 36 characters).
-4016 (futures)PRICE_HIGHTER_THAN_MULTIPLIER_UPPrice is higher than the mark price multiplier cap (futures).
-4023 (futures)QTY_NOT_INCREASED_BY_STEP_SIZEQuantity not increased by step size (futures): quantity is not a multiple of stepSize.
-4024 (futures)PRICE_LOWER_THAN_MULTIPLIER_DOWNPrice is lower than the mark price multiplier floor (futures).
-4028 (futures)INVALID_LEVERAGEInvalid leverage (futures).
-4046 (futures)NO_NEED_TO_CHANGE_MARGIN_TYPENo need to change margin type: it is already set (futures). Harmless.
-4047 (futures)THERE_EXISTS_OPEN_ORDERSMargin type cannot be changed while there are open orders (futures).
-4048 (futures)THERE_EXISTS_QUANTITYMargin type cannot be changed while there is an open position (futures).
-4059 (futures)NO_NEED_TO_CHANGE_POSITION_SIDENo need to change position side: already set (futures). Harmless.
-4061 (futures)POSITION_SIDE_NOT_MATCHOrder's position side does not match the account setting (futures one-way vs hedge mode).
-4062 (futures)REDUCE_ONLY_CONFLICTInvalid or improper reduceOnly value (futures).
-4116 (futures)DUPLICATED_CLIENT_ORDER_IDclientOrderId is duplicated (futures).
-4118 (futures)REDUCE_ONLY_MARGIN_CHECK_FAILEDReduceOnly order failed (futures): with your existing position and open orders it would open the opposite side.
-4120 (futures)STOP_ORDER_SWITCH_ALGOOrder type not supported for this endpoint (futures): use the Algo Order API endpoints instead.
-4131 (futures)MARKET_ORDER_REJECTMarket order rejected: the counterparty's best price is outside the PERCENT_PRICE limit (futures).
-4140 (futures)INVALID_OPENING_POSITION_STATUSInvalid symbol status for opening a position (futures).
-4164 (futures)MIN_NOTIONALOrder notional too small (futures): price x quantity must be at least the symbol minimum (often 5 USDT, some symbols more) unless reduce-only. Step-by-step fix
-5021 (futures)FOK_ORDER_REJECTFOK order rejected because it could not be filled immediately in full (futures).
-5022 (futures)GTX_ORDER_REJECTPost-only (GTX) order rejected because it would trade immediately as a taker (futures).
-5028 (futures)ME_RECVWINDOW_REJECTTimestamp outside the matching engine's recvWindow (futures).
-2021 (futures)ORDER_WOULD_IMMEDIATELY_TRIGGEROrder would immediately trigger (futures stop/take-profit price is already crossed).
-2022 (futures)REDUCE_ONLY_REJECTReduceOnly order rejected (futures).
Bybit (v5 API): 60 codes explained in detail (of 716 official codes searchable above)
Source: https://bybit-exchange.github.io/docs/v5/error, read 2026-11-28
CodeNameMeaning
10003API key is invalid, or the key and the domain do not match.
10016Server error (or service restarting).
33004Your API key has expired (derivatives).
10000Server timeout.
10001Request parameter error: a parameter is missing, wrong type or not allowed.
10002Request time outside the time window: your timestamp differs too much from Bybit server time.
10004Signature error: the signature does not match.
10005Permission denied: the API key lacks the permission for this action.
10006Too many visits: you exceeded the API rate limit for your UID.
10007User authentication failed.
10010Unmatched IP: your IP is not in the API key's bound IP list.
10017Route not found: wrong endpoint path or method.
10018Exceeded the IP rate limit.
10024Compliance rules triggered.
10027Transactions are banned on this account.
10029The requested symbol is invalid (not in the symbol whitelist).
110001Order does not exist.
110003Order price exceeds the allowable range.
110004Wallet balance is insufficient.
110006Your assets are estimated not to cover the position margin.
110007Available balance is insufficient for this order (margin + fees).
110008The order has been completed or cancelled already.
110009The number of stop (conditional) orders exceeds the maximum.
110012Insufficient available balance.
110013Cannot set leverage due to risk limit level.
110017orderQty will be truncated to zero: the quantity rounds to 0 at the lot step (size too small).
110020Not allowed to have more than 500 active orders.
110021Position limit exceeded due to open interest.
110024You have an existing position, so the position mode cannot be switched.
110025Position mode has not been modified (already set). Harmless.
110026Cross/isolated margin mode has not been modified (already set). Harmless.
110028You have open orders, so the position mode cannot be switched.
110043Set leverage has not been modified (leverage already at this value). Harmless.
110044Available margin is insufficient.
110045Wallet balance is insufficient.
110072orderLinkId is duplicated.
110079The order is still processing and cannot be operated; try again later.
110090Order rejected because the position may exceed the max limit.
110092Trigger price wrong side: you expected a rising trigger but triggerPrice is not above the current price.
110093Trigger price wrong side: you expected a falling trigger but triggerPrice is not below the current price.
110094Order notional value is below the lower limit.
170001Internal error (spot).
170005Too many new orders (spot order rate limit).
170033Margin: insufficient account balance.
170121Invalid symbol (spot).
170124Order amount too large (spot).
170130Data sent for a parameter is not valid (spot).
170131Balance insufficient (spot).
170134Order price has too many decimals (spot).
170136Order quantity is lower than the minimum (spot). Step-by-step fix
170137Order quantity has too many decimals (spot).
170140Order value is below the minimum (spot).
170148Market order amount has too many decimals (spot).
170193Buy order price cannot be higher than the allowed limit (spot).
170194Sell order price cannot be lower than the allowed limit (spot).
170210New order rejected (spot).
170213Order does not exist (spot).
170217Only LIMIT-MAKER orders are supported for this pair right now (spot).
170218LIMIT-MAKER order rejected due to invalid price (spot): it would take liquidity.
170222Too many requests in this time frame (spot).
OKX (v5 API): 59 codes explained in detail (of 1044 official codes searchable above)
Source: https://www.okx.com/docs-v5/en/#error-code, read 2026-11-28
CodeNameMeaning
1Operation failed: look at data[].sCode / sMsg for the real reason of each order.
2Bulk operation partially succeeded: some orders failed; check each data[].sCode.
50001Service temporarily unavailable.
50004Endpoint request timeout: the result is unknown (it may have succeeded).
50011Rate limit reached / too many requests.
50013Systems are busy; try again later.
50014A required parameter is empty.
50061You reached the maximum order rate limit for this account.
50100API frozen: contact customer service.
50101API key does not match the current environment (live vs demo trading).
50102Timestamp request expired: OK-ACCESS-TIMESTAMP is too far from server time.
50103Request header OK-ACCESS-KEY is empty.
50104Request header OK-ACCESS-PASSPHRASE is empty.
50105Request header OK-ACCESS-PASSPHRASE is incorrect.
50110Your IP is not in the API key's IP whitelist.
50111Invalid OK-ACCESS-KEY.
50112Invalid OK-ACCESS-TIMESTAMP format.
50113Invalid signature.
50114Invalid authorization.
50119API key does not exist.
50120This API key does not have permission for this function.
51000Parameter error: the parameter named in the message is wrong.
51001Instrument ID does not exist.
51006Order price is not within the price limit (max buy / min sell price).
51010Request unsupported under the current account mode.
51011Order ID already exists.
51016Client order ID already exists.
51020Order amount is below the minimum order size. Step-by-step fix
51023Position does not exist.
51024Trading account is blocked or restricted (sMsg gives the reason: compliance, verification, region or risk control).
51025Order count exceeds the limit.
51027Contract expired.
51094TP limit orders cannot be placed in spot, margin or options trading.
51100Take-profit / stop-loss cannot be attached to reduce-only orders.
51101Order size is above the maximum contracts per order.
51112Close order size exceeds the available size for this position.
51116Order price or trigger price exceeds the allowed level.
51120Order amount is less than the minimum.
51121Order quantity must be a multiple of the lot size (lotSz). Step-by-step fix
51122Order price is below the minimum price.
51131Insufficient balance.
51137The highest price limit for buy orders is exceeded.
51138The lowest price limit for sell orders is exceeded.
51149Order timed out: the result is unknown.
51150The precision of the size or price exceeds the limit.
51155Trading this pair/contract is restricted due to local compliance requirements.
51169No position in this direction to reduce.
51170A reduce-only order cannot be in the same direction as the existing position.
51201Value of the market order exceeds the maximum.
51202Market order amount exceeds the maximum amount.
51204The price for a limit order cannot be empty.
51400Cancellation failed: the order has been filled, cancelled or does not exist.
51503Order amend failed: the order has already been filled or cancelled.
51603Order does not exist.
59000Settings failed: close positions or orders before changing this setting.
59102Leverage exceeds the maximum limit.
59103Account margin is insufficient and leverage is too low.
59200Insufficient account balance.
51008Order failed: insufficient balance or margin (sub-codes 51008_xxxx give the exact case).

What it does not do

Inside an AI coding tool? The same explainer is the AIKIT tool explain_trading_error for Claude, ChatGPT and Cursor, with a signed receipt for every answer. To check a whole EA or bot for these mistakes before they happen, use the free EA code check.

Sources and dates

Every meaning comes from the platform's own documentation, read on 2026-11-28: MQL5 trade return codes, MQL5 runtime errors, Binance spot errors, Binance USDS-M futures errors, Bybit v5 errors and OKX v5 error codes. The plain explanations and fix steps are ours.

Need all 2,368 error codes with fix steps as data? They are in the Pro plan of the Trading Facts Feed.

How was this?

1 = not useful, 5 = exactly what I needed
Add a note (optional)

We keep every review, good or bad. No tracking: we store the stars, your words and a hash of your address, never the address.