MT5 error 10035: Incorrect or prohibited order type (TRADE_RETCODE_INVALID_ORDER)
The order type isn't allowed for this symbol, for example a stop limit the broker doesn't offer. Nothing was executed.
What it means
You see this code in the retcode of a trade result, from OrderSend() in MQL5 or order_send() in Python.
Each symbol lists the order types it accepts: market, limit, stop, stop limit and so on. 10035 means your type is not in that list, or doesn't fit the action.
Brokers often switch off stop limit orders, or allow only market orders on some symbols.
Common causes
- A stop limit order on a symbol that doesn't allow it.
- A pending order on a symbol that accepts market orders only.
- A close by request where close by is not allowed.
How to fix it
- Read
symbol_info(name).order_mode. It is a bit mask: 1 market, 2 limit, 4 stop, 8 stop limit, 16 stop loss, 32 take profit, 64 close by. - Use a type that is allowed, or manage the entry in your own code.
Example in Python:
import MetaTrader5 as mt5
mode = mt5.symbol_info("EURUSD").order_mode
allowed = {name: bool(mode & bit) for name, bit in
[("market", 1), ("limit", 2), ("stop", 4), ("stop limit", 8), ("close by", 64)]}
print(allowed) Is it safe to retry?
After switching to an allowed order type.
Could the order have executed?
No. The order was refused.
How Tickwire handles it
Tickwire checks the order types the symbol allows before sending, so a type the broker doesn't accept is refused with nothing sent.
Stop limit orders don't exist on MT4. On an MT4 account they are refused with not_supported_on_mt4. See platforms.
Related codes
One API for MT4 and MT5
Clear trade outcomes, idempotent orders and an audit log. Read the error reference or the quickstart.