MetaTrader 5 troubleshooting
What should you check after MT5 return code 10010?
MT5 return code 10010 means the server completed only part of the request. Before sending another order, match the original order to its executed deals and check whether any remaining volume is still active.
1. Match the deals to the original order
In Toolbox → History, right-click and show orders and deals together to trace the original order and its fills. Record the requested volume and add the volumes of the deals linked to that order. An EA can match deal history's DEAL_ORDER to the order ticket, deduplicate by DEAL_TICKET, and read each deal's DEAL_VOLUME. The account's total position volume can reflect other orders, especially on a netting account, so it does not tell you how much this order filled.
2. Check what happened to the unfilled volume
Look for the order in Toolbox → Trade and check the last known order state in History. For Immediate or Cancel (IOC), the unfilled amount is canceled. With Return, an eligible order's remainder can be processed further. Fill or Kill (FOK) requires the full requested volume for execution, but that volume can be assembled from several offers. Check the actual filling policy and order state before treating the remainder as canceled or still working.
Worked example. A demo order requested 1.00 lot and the confirmed deals show 0.30 and 0.25 lots for that order. At that point, 0.55 lots are filled and 0.45 remain unfilled. If the IOC order is already finalized, the 0.45 was canceled. If a Return order is still active, that 0.45 may still be available for further execution. The same subtraction gives two different operational outcomes.
3. Wait for the order state before making another decision
An EA can use OnTradeTransaction() to record request results and reconcile deal additions with current order state. One request can produce several transaction events, and they may arrive in a different order from the underlying operations. Treat the initial response as an update. Reconcile the latest order and deals before taking any follow-up action. Sending the full request again could duplicate the part that already filled.
Frequently asked questions
Does more than one deal mean an order was only partially filled?
Not necessarily. Several deals can add up to the entire requested volume. Add the deals that share the order ticket and check the final order state.
Is return code 10010 the same as 10008?
No. Code 10008 reports that an order was placed. Code 10010 reports that part of the request was completed. Check history and active orders to see the current outcome.
Get help with the diagnosis
Bring the requested lots, each confirmed fill volume, the filling policy and the remaining order state. Use aliases for account and ticket identifiers in public.
Ask in TradeMaster Discord