MetaTrader 5 troubleshooting
How do you fix MT5 error 10021?
MT5 trade server code 10021 means the server had no quote to process the request. Open Market Watch for the exact symbol used by the order, and check whether its Bid, Ask and last quote time are updating.
1. Check the actual request symbol
Compare the symbol in the request with the name in Market Watch, including any broker suffix. If the symbol exists but is hidden, show it and check its quote. An EA developer can use SymbolSelect() to select it and SymbolIsSynchronized() to check data synchronization. Synchronization by itself does not show that a new quote has arrived.
2. Separate quote availability from the trading schedule
Open the symbol's Specification and check its quote and trade sessions separately. A chart can still show the last known price even after quotes stop. MetaQuotes distinguishes 10018, market closed, from 10021, no quotes for the request, and 10031, no connection with the trade server. Use the actual return code instead of inferring it from the chart.
Worked example. Suppose your demo order targets XAUUSD.m at 13:02 server time. Its last quote is from 12:49, while another symbol has a quote from 13:02. The other symbol shows that some data is still arriving. It does not show that XAUUSD.m has a current quote.
3. Record the last quote and stop blind retries
An EA can log SymbolInfoTick() success, the exact symbol, Bid, Ask and tick timestamp, alongside the trade return code. Use the same time basis when comparing the attempt and the quote. TimeCurrent() can reflect a quote from another Market Watch symbol outside the EA's OnTick() handler. Suppress retries while the request symbol has no suitable quote and reevaluate whether the setup is still valid when one appears. If fresh quotes are visible and the server repeatedly reports 10021 during the published session, send the exact symbol and timestamps to broker support.
Frequently asked questions
Why does MT5 show a price but return no quotes?
Market Watch or the chart may be displaying an earlier quote. Check the update time for the exact symbol and compare it with the request time.
Is 10021 the same as 10020 price changed?
No. MetaQuotes uses 10020 when prices changed. Code 10021 means the server had no quote to process the request.
Get help with the diagnosis
Bring the symbol, return code, last quote timestamp and request timestamp. Keep your account and login details private.
Ask in TradeMaster Discord