Back to guides
MT5 Error 4109 Trade Not Allowed: What MT5 Reports Instead

MT5 Error 4109 Trade Not Allowed: What MT5 Reports Instead

Benjamin F., Co-founder5 min read

If you searched for MT5 error 4109 "trade not allowed", the first thing to know is that 4109 is a MetaTrader 4 code. The MQL4 reference lists it as ERR_TRADE_NOT_ALLOWED and tells you to enable live trading in the Expert Advisor's properties, whereas MetaTrader 5 numbers its errors differently and reports the same problem as 4752 or 10027, never as 4109.

That difference matters when you look for a fix. Advice written for MT4 points at settings that have moved or been renamed in MT5, and a 4109 that genuinely appears in an MT5 log means something that has nothing to do with trading. This guide sorts out which code you actually have and what each one needs.

Error 4109 in MT4 and its MT5 equivalents#

PlatformCodeConstantMetaQuotes' description
MT44109ERR_TRADE_NOT_ALLOWEDTrade is not allowed. Enable "Allow live trading" in the EA properties
MT54752ERR_TRADE_DISABLEDTrading by Expert Advisors prohibited
MT510027TRADE_RETCODE_CLIENT_DISABLES_ATAutotrading disabled by client terminal
MT510026TRADE_RETCODE_SERVER_DISABLES_ATAutotrading disabled by server
MT54109ERR_CHART_WRONG_PROPERTYWrong chart property ID

Sources: MQL4 error codes, MQL5 runtime errors and MQL5 trade server return codes.

MT5 effectively splits the old MT4 error in two. A runtime error such as 4752 is raised inside the EA's code, while a return code such as 10027 comes back in the result of the trade request. Which of the two you see depends on how the EA reports its failures, but both mean the order was blocked before it ever reached the market.

How to fix "trade not allowed" in MT5 (4752 and 10027)#

These are permission problems, and the fix lives in the terminal:

  1. 10027 means the Algo Trading button in the toolbar is off, which older builds call AutoTrading, so click it or press Ctrl+E until it shows as enabled.
  2. 4752 means this EA's own permission is off, so open the EA's properties from the chart and tick Allow Algo Trading on the Common tab.
  3. 10026 means the broker's server does not allow automated trading on this account, so ask the broker or prop firm whether your account type permits EAs.

Check the Experts tab under Tools → Options as well, labelled Expert Advisors in older builds. MT5 can switch algorithmic trading off automatically when you change account, profile, or the chart's symbol or timeframe, which is the usual reason it was on yesterday and off today. If you logged in with the read-only investor password, every order fails no matter which switches are on, and our guide to an MT5 EA that is not trading goes through all of these causes in detail.

What a real error 4109 means in MT5#

A genuine 4109 in an MT5 log is ERR_CHART_WRONG_PROPERTY, raised by code that reads or changes a chart setting, such as ChartGetInteger or ChartSetInteger, with a property identifier the chart does not have. It does not stop trades on its own, so if you wrote the EA or indicator, check the property constant passed on the line that failed, and if it is a third-party tool, report the full log line to its developer. One log line often carries both the EA's message and the platform's, so before you do either, confirm that the code really was 4109 and not a trade error printed nearby.

How to fix error 4109 in MT4#

In MT4, the fix is the one MetaQuotes gives in the error text. Open the EA's properties, go to the Common tab and tick Allow live trading, then make sure the AutoTrading button in the toolbar is on and check the global default under Tools → Options → Expert Advisors. The same investor-password and broker-permission causes apply on MT4 as well.

How PineHook reports trading permission errors#

PineHook runs on MT5, so the codes you can meet are 10027 and 4752, and neither of them ever appears on its own. When an alert fails for a permission reason, its Signal Logs row shows the broker's description next to the code, so you read that automated trading is disabled rather than a number you then have to look up, and the same text appears in the terminal's Experts tab.

Better still, you can catch the problem before any alert fails. Signal Logs → Test EA Connection checks the live route to your license without placing a trade and lists AutoTrading, EA trading, account trading and whether the account allows EAs, each marked on or off, so the switch that is blocking you is named for you. You can create a PineHook account without payment details and run that test on your own terminal.

FAQ#

Why do so many guides call it "MT5 error 4109"?

Most traders search for an error by its number, and many EAs and bridges started life on MT4, where 4109 is the correct code. The fix for the trading problem is similar on both platforms, but MT5 reports it with a different code, and a real 4109 in MT5 is a chart error.

Can a broker cause MT5 error 4752?

Usually, the cause is in the terminal, either the Algo Trading button or the EA's own permission. A block the broker places on your account normally comes back as 10026 in the trade result, so ask the broker only once both terminal switches are confirmed on.

MetaTrader is a trademark of MetaQuotes, and PineHook is an independent product that is not affiliated with, endorsed by, or sponsored by MetaQuotes. Leveraged trading carries a high risk of loss, so test any automated setup on a demo account before you trade it live.

ShareX

Related posts