MT4 error 4109: Trade is not allowed (ERR_TRADE_NOT_ALLOWED)

Trading is switched off in the terminal: the AutoTrading button is off, or live trading is off for this program. Nothing was sent.

4109ERR_TRADE_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 terminal blocked the trade before it left. Automated trading must be on in two places: the AutoTrading button on the toolbar, and the program's own settings.

Common causes

  • The AutoTrading button is off.
  • "Allow live trading" isn't ticked in the program's properties.
  • The terminal turned AutoTrading off, for example after an account change.

How to fix it

  • Turn on AutoTrading on the toolbar.
  • Open the program's properties, Common tab, and tick "Allow live trading".
  • Check IsTradeAllowed() before sending.

Example in MQL4:

if(!IsTradeAllowed())
{
   Print("Trading is off: turn on AutoTrading and Allow live trading");
   return;
}

Is it safe to retry?

After trading is switched on.

Could the order have executed?

No. The terminal refused the call, so no request left it.

How Tickwire handles it

Tickwire treats it like MT5 10027, and the MT4 code stays in the message.

Tickwire checks this before sending and answers 10027 with nothing sent. Health shows it too, through trading_enabled. See health.

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.