Download MetaTrader 5

Return Codes of the Trade Server

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.

Code

Constant

Description

10004

TRADE_RETCODE_REQUOTE

Requote

10006

TRADE_RETCODE_REJECT

Request rejected

10007

TRADE_RETCODE_CANCEL

Request canceled by trader

10008

TRADE_RETCODE_PLACED

Order placed

10009

TRADE_RETCODE_DONE

Request completed

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

10014

TRADE_RETCODE_INVALID_VOLUME

Invalid volume in the request

10015

TRADE_RETCODE_INVALID_PRICE

Invalid price in the request

10016

TRADE_RETCODE_INVALID_STOPS

Invalid stops in the request

10017

TRADE_RETCODE_TRADE_DISABLED

Trade is disabled

10018

TRADE_RETCODE_MARKET_CLOSED

Market is closed

10019

TRADE_RETCODE_NO_MONEY

There is not enough money to complete the request

10020

TRADE_RETCODE_PRICE_CHANGED

Prices changed

10021

TRADE_RETCODE_PRICE_OFF

There are no quotes to process the request

10022

TRADE_RETCODE_INVALID_EXPIRATION

Invalid order expiration date in the request

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

10027

TRADE_RETCODE_CLIENT_DISABLES_AT

Autotrading disabled by client terminal

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

10031

TRADE_RETCODE_CONNECTION

No connection with the trade server

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


Updated: 2015.12.03