New

Complete Suite: all 11 tools. 5 new Premium desks inside.All 11 tools $557.98 one by one

$557.98 one by one $97 once Save $460.98Get the SuiteGet it

MT5 error codes, in MQL5's words

Type the number after retcode= in the Experts or Journal tab and read what MQL5's reference says it means. The codes traders search for most have a page with the cause and a fix.

Updated 22 October 2026. Runs in your browser; nothing you type is uploaded.

The number after retcode= in MT5's Experts or Journal tab. 41 codes, as MQL5's reference words them.

41 codes match.

  • 10004

    TRADE_RETCODE_REQUOTE

    Requote

    Cause and fix
  • 10006

    TRADE_RETCODE_REJECT

    Request rejected

    Cause and fix
  • 10007

    TRADE_RETCODE_CANCEL

    Request canceled by trader

  • 10008

    TRADE_RETCODE_PLACED

    Order placed

  • 10009

    TRADE_RETCODE_DONE

    Request completed

    Cause and fix
  • 10010

    TRADE_RETCODE_DONE_PARTIAL

    Only part of the request was completed

  • 10011

    TRADE_RETCODE_ERROR

    Request processing error

  • 10012

    TRADE_RETCODE_TIMEOUT

    Request canceled by timeout

  • 10013

    TRADE_RETCODE_INVALID

    Invalid request

    Cause and fix
  • 10014

    TRADE_RETCODE_INVALID_VOLUME

    Invalid volume in the request

    Cause and fix
  • 10015

    TRADE_RETCODE_INVALID_PRICE

    Invalid price in the request

    Cause and fix
  • 10016

    TRADE_RETCODE_INVALID_STOPS

    Invalid stops in the request

    Cause and fix
  • 10017

    TRADE_RETCODE_TRADE_DISABLED

    Trade is disabled

    Cause and fix
  • 10018

    TRADE_RETCODE_MARKET_CLOSED

    Market is closed

    Cause and fix
  • 10019

    TRADE_RETCODE_NO_MONEY

    There is not enough money to complete the request

    Cause and fix
  • 10020

    TRADE_RETCODE_PRICE_CHANGED

    Prices changed

  • 10021

    TRADE_RETCODE_PRICE_OFF

    There are no quotes to process the request

    Cause and fix
  • 10022

    TRADE_RETCODE_INVALID_EXPIRATION

    Invalid order expiration date in the request

    Cause and fix
  • 10023

    TRADE_RETCODE_ORDER_CHANGED

    Order state changed

  • 10024

    TRADE_RETCODE_TOO_MANY_REQUESTS

    Too frequent requests

  • 10025

    TRADE_RETCODE_NO_CHANGES

    No changes in request

  • 10026

    TRADE_RETCODE_SERVER_DISABLES_AT

    Autotrading disabled by server

    Cause and fix
  • 10027

    TRADE_RETCODE_CLIENT_DISABLES_AT

    Autotrading disabled by client terminal

    Cause and fix
  • 10028

    TRADE_RETCODE_LOCKED

    Request locked for processing

  • 10029

    TRADE_RETCODE_FROZEN

    Order or position frozen

  • 10030

    TRADE_RETCODE_INVALID_FILL

    Invalid order filling type

    Cause and fix
  • 10031

    TRADE_RETCODE_CONNECTION

    No connection with the trade server

    Cause and fix
  • 10032

    TRADE_RETCODE_ONLY_REAL

    Operation is allowed only for live accounts

  • 10033

    TRADE_RETCODE_LIMIT_ORDERS

    The number of pending orders has reached the limit

  • 10034

    TRADE_RETCODE_LIMIT_VOLUME

    The volume of orders and positions for the symbol has reached the limit

  • 10035

    TRADE_RETCODE_INVALID_ORDER

    Incorrect or prohibited order type

  • 10036

    TRADE_RETCODE_POSITION_CLOSED

    Position with the specified POSITION_IDENTIFIER has already been closed

  • 10038

    TRADE_RETCODE_INVALID_CLOSE_VOLUME

    A close volume exceeds the current position volume

  • 10039

    TRADE_RETCODE_CLOSE_ORDER_EXIST

    A close order already exists for a specified position. This may happen when working in the hedging system: when attempting to close a position with an opposite one, while close orders for the position already exist when attempting to fully or partially close a position if the total volume of the already present close orders and the newly placed one exceeds the current position volume

  • 10040

    TRADE_RETCODE_LIMIT_POSITIONS

    The number of open positions simultaneously present on an account can be limited by the server settings. After a limit is reached, the server returns the TRADE_RETCODE_LIMIT_POSITIONS error when attempting to place an order. The limitation operates differently depending on the position accounting type: Netting — number of open positions is considered. When a limit is reached, the platform does not let placing new orders whose execution may increase the number of open positions. In fact, the platform allows placing orders only for the symbols that already have open positions. The current pending orders are not considered since their execution may lead to changes in the current positions but it cannot increase their number. Hedging — pending orders are considered together with open positions, since a pending order activation always leads to opening a new position. When a limit is reached, the platform does not allow placing both new market orders for opening positions and pending orders.

  • 10041

    TRADE_RETCODE_REJECT_CANCEL

    The pending order activation request is rejected, the order is canceled

  • 10042

    TRADE_RETCODE_LONG_ONLY

    The request is rejected, because the "Only long positions are allowed" rule is set for the symbol (POSITION_TYPE_BUY)

  • 10043

    TRADE_RETCODE_SHORT_ONLY

    The request is rejected, because the "Only short positions are allowed" rule is set for the symbol (POSITION_TYPE_SELL)

  • 10044

    TRADE_RETCODE_CLOSE_ONLY

    The request is rejected, because the "Only position closing is allowed" rule is set for the symbol

    Cause and fix
  • 10045

    TRADE_RETCODE_FIFO_CLOSE

    The request is rejected, because "Position closing is allowed only by FIFO rule" flag is set for the trading account (ACCOUNT_FIFO_CLOSE=true)

  • 10046

    TRADE_RETCODE_HEDGE_PROHIBITED

    The request is rejected, because the "Opposite positions on a single symbol are disabled" rule is set for the trading account. For example, if the account has a Buy position, then a user cannot open a Sell position or place a pending sell order. The rule is only applied to accounts with hedging accounting system (ACCOUNT_MARGIN_MODE=ACCOUNT_MARGIN_MODE_RETAIL_HEDGING).

    Cause and fix

Return codes with a cause and a fix

10004 Requote
TRADE_RETCODE_REQUOTE
10006 Request rejected
TRADE_RETCODE_REJECT
10009 Request completed
TRADE_RETCODE_DONE
10013 Invalid request
TRADE_RETCODE_INVALID
10014 Invalid volume in the request
TRADE_RETCODE_INVALID_VOLUME
10015 Invalid price in the request
TRADE_RETCODE_INVALID_PRICE
10016 Invalid stops in the request
TRADE_RETCODE_INVALID_STOPS
10017 Trade is disabled
TRADE_RETCODE_TRADE_DISABLED
10018 Market is closed
TRADE_RETCODE_MARKET_CLOSED
10026 Autotrading disabled by server
TRADE_RETCODE_SERVER_DISABLES_AT
10027 Autotrading disabled by client terminal
TRADE_RETCODE_CLIENT_DISABLES_AT
10030 Invalid order filling type
TRADE_RETCODE_INVALID_FILL

Every other code is in the lookup above, worded as in MQL5's table.

Method and privacy

Method: The 41 codes, constants and descriptions are MQL5's reference table of trade server return codes, read 22 October 2026. The lookup runs in your browser.

Calculations run entirely in your browser — nothing you type is uploaded. Your last numbers stay in this browser so you can pick up where you left off; Forget them clears them. A link with your numbers carries them after the # sign, which browsers do not send to servers, and the page takes them out of the address before any analytics loads. Copy and download actions save your calculation locally. The site may record coarse tool actions under its privacy policy, without inputs, results, file contents or filenames.

Read a whole MT5 EA's source

Goes deeper

Limits and trading risk

These tools calculate from your inputs, supported historical records or explicitly labelled teaching examples. They do not verify a live account, predict future returns or confirm that a broker or prop-firm rule has been met. Missing costs, floating losses and changed market conditions can materially change outcomes. Trading can lose the capital committed to it; check the stated method and your account specifications.

Read the risk disclosure