MT5 error 10021: No quotes to process the request (TRADE_RETCODE_PRICE_OFF)

The server had no valid price to fill the request at, often called off quotes. Nothing was executed; wait for a fresh tick and retry.

10021TRADE_RETCODE_PRICE_OFF
Yes, after a waitSafe to retry?
NoCould it have executed?

What it means

You see this code in the retcode of a trade result, from OrderSend() in MQL5 or order_send() in Python.

The trade server could not find a current price for the symbol when it processed your request. Without a price it can't fill a market order.

This often appears for a moment when a market opens, during a feed gap, or when the broker pulls prices during big news.

Common causes

  • The first seconds after a market opens.
  • A pause in the broker's price feed.
  • A symbol that is rarely quoted.
  • Prices withdrawn during a major event.

How to fix it

  • Wait for a new tick and try again with that price.
  • Check that the symbol is in Market Watch and that its last tick is recent.
  • Avoid sending orders in the first seconds of a session if you see this often.

Example in Python:

import time
import MetaTrader5 as mt5

def wait_for_tick(symbol, newer_than, timeout=5.0):
    end = time.time() + timeout
    while time.time() < end:
        t = mt5.symbol_info_tick(symbol)
        if t and t.time_msc > newer_than:
            return t
        time.sleep(0.2)
    return None

last = mt5.symbol_info_tick("EURUSD").time_msc
tick = wait_for_tick("EURUSD", last)   # then send again with tick.ask or tick.bid

Is it safe to retry?

Yes, after a fresh quote arrives.

Could the order have executed?

No. Nothing could be filled without a price.

How Tickwire handles it

Tickwire refuses an order before sending if the terminal has no quote for the symbol. If the broker answers 10021 to a market order, Tickwire retries with a fresh price, up to 2 more times.

MT4 error 136 comes back as 10021.

Related MT5 Python functions

All MetaTrader error codes

One API for MT4 and MT5

Clear trade outcomes, idempotent orders and an audit log. Read the error reference or the quickstart.