YI GOLD

MT4 / MT5 Error Codes & Trading Tools

Search official trade, runtime and compilation codes and warnings. Calculate risk using actual contract specifications.

Position & Risk

Size exposure using equity, stop distance and actual specifications.

Open calculator
Advanced contract parameters

Margin & Value

Estimate margin, tick value and price-move value.

Open calculator
Advanced contract parameters

Compound & Drawdown

A mathematical scenario, not a forecast of strategy returns.

Open calculator

Calculations run locally in your browser. Inputs are not uploaded or saved. Terminal and broker margin rules apply; estimates exclude slippage, commission and swap.

Official error code lookup

1171 matching records

Platform / categoryCode / constantOfficial meaningTroubleshooting
MT5 · Trade return codes10017 TRADE_RETCODE_TRADE_DISABLEDTrade is disabled
YI GOLD suggestions

Check server time, gold trading sessions, holidays and terminal/EA permissions. Wait for availability instead of repeatedly retrying closed-market requests.

MetaQuotes
MT5 · Trade return codes10018 TRADE_RETCODE_MARKET_CLOSEDMarket is closed
YI GOLD suggestions

Check server time, gold trading sessions, holidays and terminal/EA permissions. Wait for availability instead of repeatedly retrying closed-market requests.

MetaQuotes
MT5 · Trade return codes10019 TRADE_RETCODE_NO_MONEYThere is not enough money to complete the request
YI GOLD suggestions

Check actual account denomination, free margin, volume and leverage. Calculate margin in the terminal and assess reduced exposure or genuine funding. Do not repeatedly submit the same request.

MetaQuotes
MT5 · Trade return codes10020 TRADE_RETCODE_PRICE_CHANGEDPrices changed
YI GOLD suggestions

Read the latest bid/ask and quote time. Check precision and allowed deviation; stop increasing exposure with stale quotes.

MetaQuotes
MT5 · Trade return codes10021 TRADE_RETCODE_PRICE_OFFThere are no quotes to process the request
YI GOLD suggestions

Read the latest bid/ask and quote time. Check precision and allowed deviation; stop increasing exposure with stale quotes.

MetaQuotes
MT5 · Trade return codes10022 TRADE_RETCODE_INVALID_EXPIRATIONInvalid order expiration date in the request
YI GOLD suggestions

Check permissions, sessions, symbol specifications, quotes and request parameters. Reproduce in a demo account. Do not retry rejected requests indefinitely.

MetaQuotes
MT5 · Trade return codes10023 TRADE_RETCODE_ORDER_CHANGEDOrder state changed
YI GOLD suggestions

Check permissions, sessions, symbol specifications, quotes and request parameters. Reproduce in a demo account. Do not retry rejected requests indefinitely.

MetaQuotes
MT5 · Trade return codes10024 TRADE_RETCODE_TOO_MANY_REQUESTSToo frequent requests
YI GOLD suggestions

Serialize account requests, verify previous outcomes, reduce frequency and use bounded backoff.

MetaQuotes
MT5 · Trade return codes10025 TRADE_RETCODE_NO_CHANGESNo changes in request
YI GOLD suggestions

Check permissions, sessions, symbol specifications, quotes and request parameters. Reproduce in a demo account. Do not retry rejected requests indefinitely.

MetaQuotes
MT5 · Trade return codes10026 TRADE_RETCODE_SERVER_DISABLES_ATAutotrading disabled by server
YI GOLD suggestions

Check permissions, sessions, symbol specifications, quotes and request parameters. Reproduce in a demo account. Do not retry rejected requests indefinitely.

MetaQuotes
MT5 · Trade return codes10027 TRADE_RETCODE_CLIENT_DISABLES_ATAutotrading disabled by client terminal
YI GOLD suggestions

Check permissions, sessions, symbol specifications, quotes and request parameters. Reproduce in a demo account. Do not retry rejected requests indefinitely.

MetaQuotes
MT5 · Trade return codes10028 TRADE_RETCODE_LOCKEDRequest locked for processing
YI GOLD suggestions

Serialize account requests, verify previous outcomes, reduce frequency and use bounded backoff.

MetaQuotes
MT5 · Trade return codes10029 TRADE_RETCODE_FROZENOrder or position frozen
YI GOLD suggestions

Check permissions, sessions, symbol specifications, quotes and request parameters. Reproduce in a demo account. Do not retry rejected requests indefinitely.

MetaQuotes
MT5 · Trade return codes10030 TRADE_RETCODE_INVALID_FILLInvalid order filling type
YI GOLD suggestions

Check permissions, sessions, symbol specifications, quotes and request parameters. Reproduce in a demo account. Do not retry rejected requests indefinitely.

MetaQuotes
MT5 · Trade return codes10031 TRADE_RETCODE_CONNECTIONNo connection with the trade server
YI GOLD suggestions

Inspect connectivity, logs and request time. Verify actual order status before bounded retries with backoff to avoid duplicate exposure after a timeout.

MetaQuotes
MT5 · Trade return codes10032 TRADE_RETCODE_ONLY_REALOperation is allowed only for live accounts
YI GOLD suggestions

Check permissions, sessions, symbol specifications, quotes and request parameters. Reproduce in a demo account. Do not retry rejected requests indefinitely.

MetaQuotes
MT5 · Trade return codes10033 TRADE_RETCODE_LIMIT_ORDERSThe number of pending orders has reached the limit
YI GOLD suggestions

Check permissions, sessions, symbol specifications, quotes and request parameters. Reproduce in a demo account. Do not retry rejected requests indefinitely.

MetaQuotes
MT5 · Trade return codes10034 TRADE_RETCODE_LIMIT_VOLUMEThe volume of orders and positions for the symbol has reached the limit
YI GOLD suggestions

Read volume_min, volume_max, volume_step and volume_limit for the actual symbol. Round down to the step; do not send an order below minimum volume.

MetaQuotes
MT5 · Trade return codes10035 TRADE_RETCODE_INVALID_ORDERIncorrect or prohibited order type
YI GOLD suggestions

Check permissions, sessions, symbol specifications, quotes and request parameters. Reproduce in a demo account. Do not retry rejected requests indefinitely.

MetaQuotes
MT5 · Trade return codes10036 TRADE_RETCODE_POSITION_CLOSEDPosition with the specified POSITION_IDENTIFIER has already been closed
YI GOLD suggestions

Check permissions, sessions, symbol specifications, quotes and request parameters. Reproduce in a demo account. Do not retry rejected requests indefinitely.

MetaQuotes
MT5 · Trade return codes10038 TRADE_RETCODE_INVALID_CLOSE_VOLUMEA close volume exceeds the current position volume
YI GOLD suggestions

Read volume_min, volume_max, volume_step and volume_limit for the actual symbol. Round down to the step; do not send an order below minimum volume.

MetaQuotes
MT5 · Trade return codes10039 TRADE_RETCODE_CLOSE_ORDER_EXISTA 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
YI GOLD suggestions

Read volume_min, volume_max, volume_step and volume_limit for the actual symbol. Round down to the step; do not send an order below minimum volume.

MetaQuotes
MT5 · Trade return codes10040 TRADE_RETCODE_LIMIT_POSITIONSThe 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.
YI GOLD suggestions

Check permissions, sessions, symbol specifications, quotes and request parameters. Reproduce in a demo account. Do not retry rejected requests indefinitely.

MetaQuotes
MT5 · Trade return codes10041 TRADE_RETCODE_REJECT_CANCELThe pending order activation request is rejected, the order is canceled
YI GOLD suggestions

Check permissions, sessions, symbol specifications, quotes and request parameters. Reproduce in a demo account. Do not retry rejected requests indefinitely.

MetaQuotes
MT5 · Trade return codes10042 TRADE_RETCODE_LONG_ONLYThe request is rejected, because the " Only long positions are allowed " rule is set for the symbol ( POSITION_TYPE_BUY )
YI GOLD suggestions

Check permissions, sessions, symbol specifications, quotes and request parameters. Reproduce in a demo account. Do not retry rejected requests indefinitely.

MetaQuotes
MT5 · Trade return codes10043 TRADE_RETCODE_SHORT_ONLYThe request is rejected, because the " Only short positions are allowed " rule is set for the symbol ( POSITION_TYPE_SELL )
YI GOLD suggestions

Check permissions, sessions, symbol specifications, quotes and request parameters. Reproduce in a demo account. Do not retry rejected requests indefinitely.

MetaQuotes
MT5 · Trade return codes10044 TRADE_RETCODE_CLOSE_ONLYThe request is rejected, because the " Only position closing is allowed " rule is set for the symbol
YI GOLD suggestions

Check permissions, sessions, symbol specifications, quotes and request parameters. Reproduce in a demo account. Do not retry rejected requests indefinitely.

MetaQuotes
MT5 · Trade return codes10045 TRADE_RETCODE_FIFO_CLOSEThe request is rejected, because " Position closing is allowed only by FIFO rule " flag is set for the trading account ( ACCOUNT_FIFO_CLOSE =true)
YI GOLD suggestions

Check permissions, sessions, symbol specifications, quotes and request parameters. Reproduce in a demo account. Do not retry rejected requests indefinitely.

MetaQuotes
MT5 · Trade return codes10046 TRADE_RETCODE_HEDGE_PROHIBITEDThe 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).
YI GOLD suggestions

Check actual account denomination, free margin, volume and leverage. Calculate margin in the terminal and assess reduced exposure or genuine funding. Do not repeatedly submit the same request.

MetaQuotes
MT5 · Compiler warnings21 Incomplete record of a date in the datetime string
YI GOLD suggestions

Review the warning line, types, initialization and return values in MetaEditor. Evaluate runtime consequences and correct the warning even when compilation succeeds.

MetaQuotes
MT5 · Compiler warnings22 Wrong number in the datetime string for the date. Requirements: Year 1970 <= X <= 3000 Month 0 <X <= 12 Day 0 <X <= 31/30/28 (29 )....
YI GOLD suggestions

Review the warning line, types, initialization and return values in MetaEditor. Evaluate runtime consequences and correct the warning even when compilation succeeds.

MetaQuotes
MT5 · Compiler warnings23 Wrong number of datetime string for time. Requirements: Hour 0 <= X <24 Minute 0 <= X <60
YI GOLD suggestions

Review the warning line, types, initialization and return values in MetaEditor. Evaluate runtime consequences and correct the warning even when compilation succeeds.

MetaQuotes
MT5 · Compiler warnings24 Invalid color in RGB format: one of RGB components is less than 0 or greater than 255
YI GOLD suggestions

Review the warning line, types, initialization and return values in MetaEditor. Evaluate runtime consequences and correct the warning even when compilation succeeds.

MetaQuotes
MT5 · Compiler warnings25 Unknown character of the escape sequences. Known: \n \r \t \\ \" \' \X \x
YI GOLD suggestions

Review the warning line, types, initialization and return values in MetaEditor. Evaluate runtime consequences and correct the warning even when compilation succeeds.

MetaQuotes
MT5 · Compiler warnings26 Too large volume of local variables (> 512Kb) of the function, reduce the number
YI GOLD suggestions

Read volume_min, volume_max, volume_step and volume_limit for the actual symbol. Round down to the step; do not send an order below minimum volume.

MetaQuotes
MT5 · Compiler warnings29 Enumeration already defined (duplication) - members will be added to the first definition
YI GOLD suggestions

Review the warning line, types, initialization and return values in MetaEditor. Evaluate runtime consequences and correct the warning even when compilation succeeds.

MetaQuotes
MT5 · Compiler warnings30 Overriding macro
YI GOLD suggestions

Review the warning line, types, initialization and return values in MetaEditor. Evaluate runtime consequences and correct the warning even when compilation succeeds.

MetaQuotes
MT5 · Compiler warnings31 The variable is declared but is not used anywhere
YI GOLD suggestions

Review the warning line, types, initialization and return values in MetaEditor. Evaluate runtime consequences and correct the warning even when compilation succeeds.

MetaQuotes
MT5 · Compiler warnings32 Constructor must be of void type
YI GOLD suggestions

Review the warning line, types, initialization and return values in MetaEditor. Evaluate runtime consequences and correct the warning even when compilation succeeds.

MetaQuotes
MT5 · Compiler warnings33 Destructor must be of void type
YI GOLD suggestions

Review the warning line, types, initialization and return values in MetaEditor. Evaluate runtime consequences and correct the warning even when compilation succeeds.

MetaQuotes

Official meanings and YI GOLD suggestions are presented separately. References are verified during version builds; page visits do not fetch external sites.