MT5 error 10011: Request processing error (TRADE_RETCODE_ERROR)
Something failed while the request was being processed. The order may or may not have executed, so check positions and deals before any retry.
What it means
You see this code in the retcode of a trade result, from OrderSend() in MQL5 or order_send() in Python.
10011 says processing broke down somewhere between the terminal and the trade server. It doesn't say at which step.
Because the failure can come after the server has acted, treat it as an unclear outcome rather than a clean rejection.
Common causes
- An internal problem on the broker's trade server.
- A connection problem in the middle of the request.
- A server under heavy load during busy market hours.
How to fix it
- Look for the effect first: positions, pending orders and recent deals with your magic number or comment.
- Only if nothing is there, decide whether to send again.
- If it repeats, check the terminal's journal and ask the broker.
Example in Python:
import MetaTrader5 as mt5
from datetime import datetime, timedelta
TAG = "job-4711" # your own id for this order, also sent as the comment
MAGIC = 4711
def find_my_order(symbol):
"""Look for the effect of an order whose answer was unclear."""
for p in mt5.positions_get(symbol=symbol) or ():
if p.magic == MAGIC and p.comment == TAG:
return "position", p.ticket
for o in mt5.orders_get(symbol=symbol) or ():
if o.magic == MAGIC and o.comment == TAG:
return "pending order", o.ticket
# Server time is not UTC, so search a wide window.
now = datetime.now()
deals = mt5.history_deals_get(now - timedelta(days=1), now + timedelta(days=1)) or ()
for d in deals:
if d.magic == MAGIC and d.comment == TAG:
return "deal", d.ticket
return None, None
r = mt5.order_send(request)
if r is not None and r.retcode == mt5.TRADE_RETCODE_ERROR:
kind, ticket = find_my_order(request["symbol"])
print("found" if kind else "nothing found yet", kind, ticket) Is it safe to retry?
Not blindly. Check whether the order exists first, or you risk two positions.
Could the order have executed?
Maybe. The code doesn't tell you, so the account state does.
How Tickwire handles it
Tickwire never sends new exposure again after 10011. It reads positions, orders and deals for the request. Found: applied. Confirmed absent: rejected. Still unclear: unknown. See when the answer is unknown.
Related codes
One API for MT4 and MT5
Clear trade outcomes, idempotent orders and an audit log. Read the error reference or the quickstart.