MT5 Error 10023 Order Changed: Check the Order State
MetaTrader 5 retcode 10023 means the trade server reports a change in the order state. If you sent a pending order modification or cancellation, start with the exact ticket from the request and check where that order is now. An order that filled, an order that disappeared from the active list and an order with an updated price each call for a different investigation.
Steps to check
- Isolate the request in the Journal or EA log. Write down the exact order ticket, symbol, action, proposed field changes and server time. Match the response to that request so a message from another order or symbol does not steer the diagnosis.
- Look for the ticket among active orders. If you are in MQL5, select the order again before reading its fields because OrderSelect copies a snapshot for later access. Compare its current state, volume, price and expiration to the values recorded before sending.
- If the ticket is absent from active orders, open the History tab and look for that specific ticket. Check the final order state and any associated deals. Save the timestamps in the same time zone so you can see which change happened first.
- Use the latest state to decide whether the original intent is still relevant. If the order already changed to the intended values, the request needs no further action. If it filled or was canceled, examine the resulting state before proposing a separate action.
Worked example
In a hypothetical demo, an EA reads a pending buy order at 10:15:01 and requests a cancellation a moment later. The server returns 10023. The ticket is absent from active orders, but history shows it filled and a deal opened a position. The investigation therefore moves to that position and its recorded protection. Creating a replacement pending order would be a separate decision and could add exposure the original cancellation was meant to avoid.
Frequently asked questions
Does 10023 mean the pending order was filled?
A fill is one possibility. Use the order ticket to check the recorded state and associated deals. A change in state alone does not establish a fill.
How is 10023 different from 10025?
10023 reports that the order state changed. 10025 reports that the submitted request produces no changes. Compare the active order and history for 10023.
Why can an EA still read an old order price?
OrderSelect copies the order data when it succeeds. Select the order again before reading its fields, and check history when the ticket no longer appears among active orders.
Related guides
Related video
Related video: how an MT5 automated setup sends orders