MT4 error 148: Too many open and pending orders (ERR_TRADE_TOO_MANY_ORDERS)
The account has reached the broker's limit on open and pending orders. Nothing was placed; close or delete some first.
What it means
You see this code in GetLastError() in MQL4, after a trade function fails on the server side.
Brokers can cap the total number of open and pending orders an account holds. At the cap, a new order is refused with 148.
Pending orders count toward the cap even if they never trigger.
Common causes
- Grid strategies that leave many orders open.
- Old pending orders never deleted.
- Several programs on one account, each placing its own orders.
How to fix it
- Check
OrdersTotal()against the limit the broker gives you. - Delete pending orders you no longer need.
Example in MQL4:
int maxOrders = 200; // the limit your broker states
if(OrdersTotal() >= maxOrders)
Print("At the order limit: ", OrdersTotal(), " orders"); Is it safe to retry?
After reducing the number of orders.
Could the order have executed?
No. The new order was refused because the account is at its order limit.
How Tickwire handles it
Tickwire treats it like MT5 10033, and the MT4 code stays in the message. See trade results.
Related codes
One API for MT4 and MT5
Clear trade outcomes, idempotent orders and an audit log. Read the error reference or the quickstart.