metatrader-error-codes / metatrader_error_codes.json
tekkick's picture
MetaTrader error code cross-reference: MT4, MT5 retcodes, MQL runtime (CC BY 4.0)
63b9c5d verified
Raw History Blame Contribute Delete
9.59 kB
{
"server_retcodes": [
{
"code": "10004",
"name": "REQUOTE",
"meaning": "Price changed before execution; broker offers a new price"
},
{
"code": "10006",
"name": "REJECT",
"meaning": "Request rejected by the server"
},
{
"code": "10007",
"name": "CANCEL",
"meaning": "Request cancelled by the trader"
},
{
"code": "10008",
"name": "PLACED",
"meaning": "Order placed — success, not an error"
},
{
"code": "10009",
"name": "DONE",
"meaning": "Request completed — success, not an error"
},
{
"code": "10010",
"name": "DONE_PARTIAL",
"meaning": "Only part of the requested volume was filled"
},
{
"code": "10011",
"name": "ERROR",
"meaning": "Request processing error on the server"
},
{
"code": "10012",
"name": "TIMEOUT",
"meaning": "Request cancelled because it timed out"
},
{
"code": "10013",
"name": "INVALID",
"meaning": "Malformed or invalid request"
},
{
"code": "10014",
"name": "INVALID_VOLUME",
"meaning": "Lot size below minimum, above maximum or off the volume step"
},
{
"code": "10015",
"name": "INVALID_PRICE",
"meaning": "The price in the request is invalid"
},
{
"code": "10016",
"name": "INVALID_STOPS",
"meaning": "SL or TP too close, on the wrong side, or inside the stops level"
},
{
"code": "10017",
"name": "TRADE_DISABLED",
"meaning": "Trading is disabled for the account or symbol"
},
{
"code": "10018",
"name": "MARKET_CLOSED",
"meaning": "The market for this symbol is closed"
},
{
"code": "10019",
"name": "NO_MONEY",
"meaning": "Not enough free margin for the requested volume"
},
{
"code": "10020",
"name": "PRICE_CHANGED",
"meaning": "Price changed while the request was being processed"
},
{
"code": "10021",
"name": "PRICE_OFF",
"meaning": "No quotes available to process the request (off quotes)"
},
{
"code": "10022",
"name": "INVALID_EXPIRATION",
"meaning": "Invalid order expiration in the request"
},
{
"code": "10023",
"name": "ORDER_CHANGED",
"meaning": "Order state changed while the request was in flight"
},
{
"code": "10024",
"name": "TOO_MANY_REQUESTS",
"meaning": "Requests sent too frequently"
},
{
"code": "10025",
"name": "NO_CHANGES",
"meaning": "The request contains no changes"
},
{
"code": "10026",
"name": "SERVER_DISABLES_AT",
"meaning": "Autotrading disabled by the server"
},
{
"code": "10027",
"name": "CLIENT_DISABLES_AT",
"meaning": "Autotrading disabled by the client terminal"
},
{
"code": "10028",
"name": "LOCKED",
"meaning": "Request locked — already being processed"
},
{
"code": "10029",
"name": "FROZEN",
"meaning": "Order or position frozen; too close to execution to modify"
},
{
"code": "10030",
"name": "INVALID_FILL",
"meaning": "Unsupported order filling mode for this symbol"
},
{
"code": "10031",
"name": "CONNECTION",
"meaning": "No connection with the trade server"
},
{
"code": "10032",
"name": "ONLY_REAL",
"meaning": "Operation allowed only on live accounts"
},
{
"code": "10033",
"name": "LIMIT_ORDERS",
"meaning": "Pending order limit for the account reached"
},
{
"code": "10034",
"name": "LIMIT_VOLUME",
"meaning": "Volume limit for the symbol reached"
},
{
"code": "10035",
"name": "INVALID_ORDER",
"meaning": "Incorrect or prohibited order type"
},
{
"code": "10036",
"name": "POSITION_CLOSED",
"meaning": "The position is already closed"
},
{
"code": "10038",
"name": "INVALID_CLOSE_VOLUME",
"meaning": "Close volume exceeds the open position volume"
},
{
"code": "10039",
"name": "CLOSE_ORDER_EXIST",
"meaning": "A close order for this position already exists"
},
{
"code": "10040",
"name": "LIMIT_POSITIONS",
"meaning": "Open position limit for the account reached"
},
{
"code": "10041",
"name": "REJECT_CANCEL",
"meaning": "Pending order activation rejected; order cancelled"
},
{
"code": "10042",
"name": "LONG_ONLY",
"meaning": "Only long positions allowed on this symbol"
},
{
"code": "10043",
"name": "SHORT_ONLY",
"meaning": "Only short positions allowed on this symbol"
},
{
"code": "10044",
"name": "CLOSE_ONLY",
"meaning": "Only position closing allowed on this symbol"
},
{
"code": "10045",
"name": "FIFO_CLOSE",
"meaning": "Positions must be closed in FIFO order (US accounts)"
},
{
"code": "10046",
"name": "HEDGE_PROHIBITED",
"meaning": "Opposite positions on the same symbol are prohibited"
}
],
"mql_runtime_errors": [
{
"runtime_code": "4752",
"name": "ERR_TRADE_DISABLED",
"what_it_means": "Trading by expert advisors is prohibited",
"where_the_real_reason_is": "Retcode 10027 — the Algo Trading button or EA permission"
},
{
"runtime_code": "4753",
"name": "ERR_TRADE_POSITION_NOT_FOUND",
"what_it_means": "The position ticket does not exist",
"where_the_real_reason_is": "Usually a netting account that has already merged the position"
},
{
"runtime_code": "4754",
"name": "ERR_TRADE_ORDER_NOT_FOUND",
"what_it_means": "The order ticket does not exist",
"where_the_real_reason_is": "Already filled, cancelled, or the wrong ticket"
},
{
"runtime_code": "4755",
"name": "ERR_TRADE_DEAL_NOT_FOUND",
"what_it_means": "The deal ticket does not exist",
"where_the_real_reason_is": "History not yet selected with HistorySelect()"
},
{
"runtime_code": "4756",
"name": "ERR_TRADE_SEND_FAILED",
"what_it_means": "The trade request was not sent, or was rejected",
"where_the_real_reason_is": "MqlTradeResult.retcode — any of the codes in the table above"
},
{
"runtime_code": "4758",
"name": "ERR_TRADE_CALC_FAIL",
"what_it_means": "OrderCalcMargin or OrderCalcProfit failed",
"where_the_real_reason_is": "Bad symbol, volume or price passed to the calculation"
},
{
"runtime_code": "4759",
"name": "ERR_TRADE_WRONG_PROPERTY",
"what_it_means": "Wrong trade property requested",
"where_the_real_reason_is": "A code error in the EA, not the broker"
}
],
"mt4_to_mt5_mapping": [
{
"mt4_error": "129",
"mt4_name": "ERR_INVALID_PRICE",
"mt5_retcode": "10015",
"diagnosis": "Invalid price — see invalid price"
},
{
"mt4_error": "130",
"mt4_name": "ERR_INVALID_STOPS",
"mt5_retcode": "10016",
"diagnosis": "Stop too close or wrong side — see invalid stops"
},
{
"mt4_error": "131",
"mt4_name": "ERR_INVALID_TRADE_VOLUME",
"mt5_retcode": "10014",
"diagnosis": "Lot size off the min/max/step — see invalid volume"
},
{
"mt4_error": "132",
"mt4_name": "ERR_MARKET_CLOSED",
"mt5_retcode": "10018",
"diagnosis": "Outside the session — see market closed"
},
{
"mt4_error": "133",
"mt4_name": "ERR_TRADE_DISABLED",
"mt5_retcode": "10017",
"diagnosis": "Trading disabled for the account or symbol"
},
{
"mt4_error": "134",
"mt4_name": "ERR_NOT_ENOUGH_MONEY",
"mt5_retcode": "10019",
"diagnosis": "Free margin — see not enough money"
},
{
"mt4_error": "135",
"mt4_name": "ERR_PRICE_CHANGED",
"mt5_retcode": "10020",
"diagnosis": "Price moved during processing"
},
{
"mt4_error": "136",
"mt4_name": "ERR_OFF_QUOTES",
"mt5_retcode": "10021",
"diagnosis": "No quotes available — see no quotes"
},
{
"mt4_error": "138",
"mt4_name": "ERR_REQUOTE",
"mt5_retcode": "10004",
"diagnosis": "Requote — see requotes"
},
{
"mt4_error": "146",
"mt4_name": "ERR_TRADE_CONTEXT_BUSY",
"mt5_retcode": "— (10024 is the nearest)",
"diagnosis": "MT5 has no trade context lock; see trade context busy"
},
{
"mt4_error": "148",
"mt4_name": "ERR_TRADE_TOO_MANY_ORDERS",
"mt5_retcode": "10033",
"diagnosis": "Pending order limit reached"
},
{
"mt4_error": "4109",
"mt4_name": "ERR_TRADE_NOT_ALLOWED",
"mt5_retcode": "10027",
"diagnosis": "EA not permitted to trade — see AutoTrading disabled"
},
{
"mt4_error": "4112",
"mt4_name": "AutoTrading disabled by server",
"mt5_retcode": "10026",
"diagnosis": "Broker-side flag — see AutoTrading disabled"
}
]
}