MT4 error 4111: Shorts are not allowed (ERR_SHORTS_NOT_ALLOWED)

The program's settings allow only long trades, so a sell was blocked in the terminal. Nothing was sent.

4111ERR_SHORTS_NOT_ALLOWED
After a fixSafe to retry?
NoCould it have executed?

What it means

You see this code in GetLastError() in MQL4, raised inside the terminal.

The mirror of 4110. With Positions set to long only, a sell raises 4111 before anything is sent.

Don't confuse it with server error 140, where the broker allows only buys.

Common causes

  • Positions set to "Long only" on the program's Common tab.

How to fix it

  • Set Positions to "Long & Short" in the program's properties.
  • If the broker itself allows only buys, you get 140 instead.
  • Check the setting each time you attach the program to a new chart.

Example in MQL4:

int ticket = OrderSend(Symbol(), OP_SELL, 0.10, Bid, 3, 0, 0, "", 4711);
int err = (ticket < 0) ? GetLastError() : 0;
if(err == ERR_SHORTS_NOT_ALLOWED) Print("Sells are off in this program's settings");
if(err == ERR_LONG_POSITIONS_ONLY_ALLOWED) Print("The broker allows only buys on ", Symbol());

Is it safe to retry?

After changing the setting.

Could the order have executed?

No. The sell was blocked in the terminal and never sent.

How Tickwire handles it

Tickwire treats it like MT5 10042, and the MT4 code stays in the message. See trade results.

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.