Position & Risk
Size exposure using equity, stop distance and actual specifications.
Search official trade, runtime and compilation codes and warnings. Calculate risk using actual contract specifications.
Size exposure using equity, stop distance and actual specifications.
Estimate margin, tick value and price-move value.
A mathematical scenario, not a forecast of strategy returns.
Calculations run locally in your browser. Inputs are not uploaded or saved. Terminal and broker margin rules apply; estimates exclude slippage, commission and swap.
1171 matching records
| Platform / category | Code / constant | Official meaning | Troubleshooting |
|---|---|---|---|
| MT5 · Trade return codes | 10017 TRADE_RETCODE_TRADE_DISABLED | Trade is disabled | YI GOLD suggestionsCheck server time, gold trading sessions, holidays and terminal/EA permissions. Wait for availability instead of repeatedly retrying closed-market requests. MetaQuotes |
| MT5 · Trade return codes | 10018 TRADE_RETCODE_MARKET_CLOSED | Market is closed | YI GOLD suggestionsCheck server time, gold trading sessions, holidays and terminal/EA permissions. Wait for availability instead of repeatedly retrying closed-market requests. MetaQuotes |
| MT5 · Trade return codes | 10019 TRADE_RETCODE_NO_MONEY | There is not enough money to complete the request | YI GOLD suggestionsCheck 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 codes | 10020 TRADE_RETCODE_PRICE_CHANGED | Prices changed | YI GOLD suggestionsRead the latest bid/ask and quote time. Check precision and allowed deviation; stop increasing exposure with stale quotes. MetaQuotes |
| MT5 · Trade return codes | 10021 TRADE_RETCODE_PRICE_OFF | There are no quotes to process the request | YI GOLD suggestionsRead the latest bid/ask and quote time. Check precision and allowed deviation; stop increasing exposure with stale quotes. MetaQuotes |
| MT5 · Trade return codes | 10022 TRADE_RETCODE_INVALID_EXPIRATION | Invalid order expiration date in the request | YI GOLD suggestionsCheck permissions, sessions, symbol specifications, quotes and request parameters. Reproduce in a demo account. Do not retry rejected requests indefinitely. MetaQuotes |
| MT5 · Trade return codes | 10023 TRADE_RETCODE_ORDER_CHANGED | Order state changed | YI GOLD suggestionsCheck permissions, sessions, symbol specifications, quotes and request parameters. Reproduce in a demo account. Do not retry rejected requests indefinitely. MetaQuotes |
| MT5 · Trade return codes | 10024 TRADE_RETCODE_TOO_MANY_REQUESTS | Too frequent requests | YI GOLD suggestionsSerialize account requests, verify previous outcomes, reduce frequency and use bounded backoff. MetaQuotes |
| MT5 · Trade return codes | 10025 TRADE_RETCODE_NO_CHANGES | No changes in request | YI GOLD suggestionsCheck permissions, sessions, symbol specifications, quotes and request parameters. Reproduce in a demo account. Do not retry rejected requests indefinitely. MetaQuotes |
| MT5 · Trade return codes | 10026 TRADE_RETCODE_SERVER_DISABLES_AT | Autotrading disabled by server | YI GOLD suggestionsCheck permissions, sessions, symbol specifications, quotes and request parameters. Reproduce in a demo account. Do not retry rejected requests indefinitely. MetaQuotes |
| MT5 · Trade return codes | 10027 TRADE_RETCODE_CLIENT_DISABLES_AT | Autotrading disabled by client terminal | YI GOLD suggestionsCheck permissions, sessions, symbol specifications, quotes and request parameters. Reproduce in a demo account. Do not retry rejected requests indefinitely. MetaQuotes |
| MT5 · Trade return codes | 10028 TRADE_RETCODE_LOCKED | Request locked for processing | YI GOLD suggestionsSerialize account requests, verify previous outcomes, reduce frequency and use bounded backoff. MetaQuotes |
| MT5 · Trade return codes | 10029 TRADE_RETCODE_FROZEN | Order or position frozen | YI GOLD suggestionsCheck permissions, sessions, symbol specifications, quotes and request parameters. Reproduce in a demo account. Do not retry rejected requests indefinitely. MetaQuotes |
| MT5 · Trade return codes | 10030 TRADE_RETCODE_INVALID_FILL | Invalid order filling type | YI GOLD suggestionsCheck permissions, sessions, symbol specifications, quotes and request parameters. Reproduce in a demo account. Do not retry rejected requests indefinitely. MetaQuotes |
| MT5 · Trade return codes | 10031 TRADE_RETCODE_CONNECTION | No connection with the trade server | YI GOLD suggestionsInspect 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 codes | 10032 TRADE_RETCODE_ONLY_REAL | Operation is allowed only for live accounts | YI GOLD suggestionsCheck permissions, sessions, symbol specifications, quotes and request parameters. Reproduce in a demo account. Do not retry rejected requests indefinitely. MetaQuotes |
| MT5 · Trade return codes | 10033 TRADE_RETCODE_LIMIT_ORDERS | The number of pending orders has reached the limit | YI GOLD suggestionsCheck permissions, sessions, symbol specifications, quotes and request parameters. Reproduce in a demo account. Do not retry rejected requests indefinitely. MetaQuotes |
| MT5 · Trade return codes | 10034 TRADE_RETCODE_LIMIT_VOLUME | The volume of orders and positions for the symbol has reached the limit | YI GOLD suggestionsRead 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 codes | 10035 TRADE_RETCODE_INVALID_ORDER | Incorrect or prohibited order type | YI GOLD suggestionsCheck permissions, sessions, symbol specifications, quotes and request parameters. Reproduce in a demo account. Do not retry rejected requests indefinitely. MetaQuotes |
| MT5 · Trade return codes | 10036 TRADE_RETCODE_POSITION_CLOSED | Position with the specified POSITION_IDENTIFIER has already been closed | YI GOLD suggestionsCheck permissions, sessions, symbol specifications, quotes and request parameters. Reproduce in a demo account. Do not retry rejected requests indefinitely. MetaQuotes |
| MT5 · Trade return codes | 10038 TRADE_RETCODE_INVALID_CLOSE_VOLUME | A close volume exceeds the current position volume | YI GOLD suggestionsRead 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 codes | 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 | YI GOLD suggestionsRead 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 codes | 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. | YI GOLD suggestionsCheck permissions, sessions, symbol specifications, quotes and request parameters. Reproduce in a demo account. Do not retry rejected requests indefinitely. MetaQuotes |
| MT5 · Trade return codes | 10041 TRADE_RETCODE_REJECT_CANCEL | The pending order activation request is rejected, the order is canceled | YI GOLD suggestionsCheck permissions, sessions, symbol specifications, quotes and request parameters. Reproduce in a demo account. Do not retry rejected requests indefinitely. MetaQuotes |
| MT5 · Trade return codes | 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 ) | YI GOLD suggestionsCheck permissions, sessions, symbol specifications, quotes and request parameters. Reproduce in a demo account. Do not retry rejected requests indefinitely. MetaQuotes |
| MT5 · Trade return codes | 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 ) | YI GOLD suggestionsCheck permissions, sessions, symbol specifications, quotes and request parameters. Reproduce in a demo account. Do not retry rejected requests indefinitely. MetaQuotes |
| MT5 · Trade return codes | 10044 TRADE_RETCODE_CLOSE_ONLY | The request is rejected, because the " Only position closing is allowed " rule is set for the symbol | YI GOLD suggestionsCheck permissions, sessions, symbol specifications, quotes and request parameters. Reproduce in a demo account. Do not retry rejected requests indefinitely. MetaQuotes |
| MT5 · Trade return codes | 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) | YI GOLD suggestionsCheck permissions, sessions, symbol specifications, quotes and request parameters. Reproduce in a demo account. Do not retry rejected requests indefinitely. MetaQuotes |
| MT5 · Trade return codes | 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). | YI GOLD suggestionsCheck 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 warnings | 21 | Incomplete record of a date in the datetime string | YI GOLD suggestionsReview the warning line, types, initialization and return values in MetaEditor. Evaluate runtime consequences and correct the warning even when compilation succeeds. MetaQuotes |
| MT5 · Compiler warnings | 22 | 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 suggestionsReview the warning line, types, initialization and return values in MetaEditor. Evaluate runtime consequences and correct the warning even when compilation succeeds. MetaQuotes |
| MT5 · Compiler warnings | 23 | Wrong number of datetime string for time. Requirements: Hour 0 <= X <24 Minute 0 <= X <60 | YI GOLD suggestionsReview the warning line, types, initialization and return values in MetaEditor. Evaluate runtime consequences and correct the warning even when compilation succeeds. MetaQuotes |
| MT5 · Compiler warnings | 24 | Invalid color in RGB format: one of RGB components is less than 0 or greater than 255 | YI GOLD suggestionsReview the warning line, types, initialization and return values in MetaEditor. Evaluate runtime consequences and correct the warning even when compilation succeeds. MetaQuotes |
| MT5 · Compiler warnings | 25 | Unknown character of the escape sequences. Known: \n \r \t \\ \" \' \X \x | YI GOLD suggestionsReview the warning line, types, initialization and return values in MetaEditor. Evaluate runtime consequences and correct the warning even when compilation succeeds. MetaQuotes |
| MT5 · Compiler warnings | 26 | Too large volume of local variables (> 512Kb) of the function, reduce the number | YI GOLD suggestionsRead 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 warnings | 29 | Enumeration already defined (duplication) - members will be added to the first definition | YI GOLD suggestionsReview the warning line, types, initialization and return values in MetaEditor. Evaluate runtime consequences and correct the warning even when compilation succeeds. MetaQuotes |
| MT5 · Compiler warnings | 30 | Overriding macro | YI GOLD suggestionsReview the warning line, types, initialization and return values in MetaEditor. Evaluate runtime consequences and correct the warning even when compilation succeeds. MetaQuotes |
| MT5 · Compiler warnings | 31 | The variable is declared but is not used anywhere | YI GOLD suggestionsReview the warning line, types, initialization and return values in MetaEditor. Evaluate runtime consequences and correct the warning even when compilation succeeds. MetaQuotes |
| MT5 · Compiler warnings | 32 | Constructor must be of void type | YI GOLD suggestionsReview the warning line, types, initialization and return values in MetaEditor. Evaluate runtime consequences and correct the warning even when compilation succeeds. MetaQuotes |
| MT5 · Compiler warnings | 33 | Destructor must be of void type | YI GOLD suggestionsReview 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.