MT5 Error 10020 Price Changed: How to Diagnose It
MT5 trade retcode 10020 means the trade server reports that prices changed. In plain terms, the quote your request relied on was no longer the one the server could use when it processed the request. This guide gives a careful way to diagnose the result on a demo account. You will record the facts of the attempt, compare the right quote side, confirm the execution mode, and check whether anything was created before you reconsider the request.
Steps to check
- Record the exact attempt first. Note the broker symbol exactly as it appears in the platform, whether the request was a buy or a sell, the time the request was sent, the time of the quote it used, and the full returned code. Keep the whole code, because neighboring codes point to different problems. Code 10015 is an invalid request price, and 10021 means no quotes are available to process the request. Writing the code down in full stops you from mixing them up.
- Confirm the execution mode for that symbol before drawing any conclusion. MetaQuotes lists price and deviation among the required fields for Request and Instant execution, while Market execution uses a different set of required fields. If you assume the wrong mode, you may blame a deviation setting that does not apply to the way the request was handled.
- Inspect the correct side of the quote. A buy is compared with the ask, and a sell is compared with the bid. Look at the quote that was current when the request was built and the latest quote your terminal recorded around the server response. Keep the timestamps explicit and write the price units next to every figure so that nothing is misread later.
- Check the deviation value and its units. MetaQuotes defines deviation in points, so compare it with the gap you observed between the requested price and the later quote, converting everything to points before you compare. Only treat deviation as relevant if the mode you confirmed in the second step actually uses it.
- Verify whether the original attempt created an order or a deal. Look at the order and deal history for the demo account before doing anything else. A rejected request and a request that left a trace need different handling, and sending again without checking could duplicate exposure.
- Recheck the latest quote and your strategy conditions before reconsidering the request. If the conditions no longer hold, leave the idea alone. Do not widen deviation or send repeated requests as a default response. Log what you learned from the demo reproduction so the next test starts from a clean record.
Worked example
This is a hypothetical demo-only illustration with invented numbers. Suppose a test buy on a demo symbol returns 10020. You note the symbol, the buy side, the request time, the quote time and the returned code. You then check the execution mode and find the symbol uses Instant execution, so price and deviation are both part of the request. Next, you read the ask, since this was a buy. In this made-up case the requested price was 1.10000 and the terminal recorded an ask around the server response of 1.10008, a gap of 8 points if one point is 0.00001. The deviation in the request was 5 points, so the observed gap exceeded it. This is a local observation to compare with the returned code. You then check the history, see no order or deal was created, and review the current quote and your test conditions. You do not simply raise deviation. You decide whether the test still makes sense and note the findings.
Frequently asked questions
What does MT5 retcode 10020 mean?
It means the trade server reported that prices changed. The quote used by the request was not the one the server could work with when it processed it.
How is 10020 different from 10015 and 10021?
Code 10015 means the request price was invalid, and 10021 means no quotes were available to process the request. Code 10020 specifically means prices changed, so record the full code before diagnosing.
Should I just increase deviation or retry until it works?
No. Confirm the execution mode first, since deviation matters differently by mode. Also check whether an order or deal was created, then recheck the latest quote and strategy conditions before deciding anything.
Related guides
Related video
Related MT5 troubleshooting example: invalid stops