MT4 error 4110: Longs are not allowed (ERR_LONGS_NOT_ALLOWED)
The program's settings allow only short trades, so a buy was blocked in the terminal. Nothing was sent.
What it means
You see this code in GetLastError() in MQL4, raised inside the terminal.
Each MT4 trading program has a Positions setting: long and short, long only, or short only. With short only, a buy raises 4110.
It is a local setting for this one program. The broker wasn't asked, and other programs in the terminal aren't affected.
Common causes
- Positions set to "Short only" on the program's Common tab.
- A setting changed during testing and never set back.
How to fix it
- Set Positions to "Long & Short" in the program's properties.
- Check the setting each time you attach the program to a new chart.
Example in MQL4:
int ticket = OrderSend(Symbol(), OP_BUY, 0.10, Ask, 3, 0, 0, "", 4711);
if(ticket < 0 && GetLastError() == ERR_LONGS_NOT_ALLOWED)
Print("Buys are off in this program's Positions setting"); Is it safe to retry?
After changing the setting.
Could the order have executed?
No. The buy was blocked in the terminal and never sent.
How Tickwire handles it
Tickwire treats it like MT5 10043, 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.