MT5 return code 10010: Only part of the request was completed (TRADE_RETCODE_DONE_PARTIAL)

MT5 return code 10010 means only part of the volume was filled. The filled part is real; decide on purpose whether to send the rest.

10010TRADE_RETCODE_DONE_PARTIAL
Check firstSafe to retry?
PartlyCould 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 server filled some of the volume and not all of it. This happens when the filling policy allows partial fills, such as IOC (fill what you can now, cancel the rest) or Return (fill what you can, leave the rest working).

result.volume tells you how much was filled. The rest was canceled under IOC, or left as an order under Return.

Common causes

  • Not enough liquidity at your price on an exchange or ECN-style symbol.
  • A large order compared with the size available at the top of the book.
  • A filling mode of ORDER_FILLING_IOC or ORDER_FILLING_RETURN.

How to fix it

  • Record the filled volume as your position size.
  • If you need the rest, send a new order for the remaining volume as a separate decision.
  • If you never want partial fills, use ORDER_FILLING_FOK on symbols that allow it.

Example in Python:

import MetaTrader5 as mt5

wanted = request["volume"]
r = mt5.order_send(request)
if r is not None and r.retcode == mt5.TRADE_RETCODE_DONE_PARTIAL:
    left = round(wanted - r.volume, 2)
    print(f"filled {r.volume} of {wanted}; {left} not filled")
    # Decide here whether to send 'left' as a new order.

Is it safe to retry?

Check first. Don't resend the whole request. Send only the part that is missing, and only if you still want it.

Could the order have executed?

Partly. The volume in result.volume was filled and is now a position.

How Tickwire handles it

Tickwire counts 10010 as success and reports outcome partial. See outcomes.

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.