Error 4109 & 4752: “Trade Not Allowed” Fix for MT4 & MT5


Your TradingView alert fired. PineConnector received it. But MetaTrader logged error 4109 "Trade is not allowed" and no position was opened. This is one of the most common errors traders hit when first setting up automated trading, and it almost always comes down to one of two permission settings being switched off in your terminal.
This guide covers what error 4109 means, why it happens in both MT4 and MT5, and the exact steps to fix it.
What is Error 4109?
Error 4109 is a MetaTrader 4 error code. Its official label is ERR_TRADE_NOT_ALLOWED, and it means MetaTrader received a trade instruction from an Expert Advisor but blocked it because automated trading is not enabled, at either the terminal level, the EA level, or both.
In plain terms: MetaTrader got the signal but refused to act on it.
This is purely a permissions issue, not a problem with your TradingView alert, your Pine Script, or your PineConnector setup. The signal arrived correctly. MetaTrader just wasn't allowed to place the trade.
Why Does Error 4109 Happen?
There are two separate permission switches that control whether an EA can trade in MetaTrader. Both need to be on. If either one is off, you'll get error 4109.
- Terminal-level automated trading is disabled : the AutoTrading button in the toolbar is red/off
- EA-level live trading is disabled : "Allow Live Trading" is unchecked in the EA's Common settings
It's also common after restarting MetaTrader. Some brokers and VPS configurations reset these settings on restart, which is why traders often see error 4109 appear after a reboot on a setup that had been working fine before.
How to Fix Error 4109 in MT4
According to the PineConnector error guide, there are two steps to resolve error 4109. Both are required.

Step 1: Enable Automated Trading at the Terminal Level
- Open MetaTrader 4
- Press Ctrl+O to open Options (or go to Tools → Options)
- Click the Expert Advisors tab
- Check "Allow automated trading"
- Click OK
You can also toggle this from the toolbar. Look for the AutoTrading button at the top. If it's red, click it to turn it green.
Step 2: Enable Live Trading in the EA Properties
- Press F7 on your chart (or right-click the chart → Expert Advisors → Properties)
- Go to the Common tab
- Check "Allow Live Trading"
- Check "Allow DLL imports" — required for PineConnector to function
- Click OK
Once both steps are done, you should see a smiley face in the top-right corner of your chart. That's the confirmation that the EA has full trading permissions and is connected correctly.
The MT5 Equivalent: Error 4752
MT5 uses a different error numbering system. The MT5 equivalent of error 4109 is error 4752 (ERR_TRADE_DISABLED), which also means trading by Expert Advisors is prohibited.


The fix is the same in principle, but the steps look slightly different in MT5:
Enable Algo Trading in MT5
- In the MT5 toolbar, locate the Algo Trading button. If it's red, click it to turn it green.
- Press F7 on your chart to open EA properties
- Under the Common tab, tick "Allow Algo Trading"
- Under the Dependencies tab, tick "Allow DLL imports"
As with MT4, both the terminal-level and EA-level settings need to be enabled. One without the other won't work.
Still Seeing The Error After Fixing Permissions?
If you've confirmed both settings are enabled and you're still getting error 4109/4752, check the following:
- Your broker may have restricted automated trading on your account type. Try opening a manual position on the same symbol. If that also fails, contact your broker.
- You're on a demo server with restrictions. Some MetaQuotes demo servers have strict rules that can interfere with EA execution. Switch to a live or prop firm account to rule this out.
- MetaTrader restarted and reset your settings. This is common on VPS environments. Re-check both permission switches after any terminal restart.
- DLL imports are still blocked. PineConnector requires DLL imports to be allowed at both the terminal and EA level. Double-check this in the EA's Common tab.
How to Prevent Error 4109/4752 from Reoccurring
A few habits will keep error 4109/4752 from catching you off guard:
- Always check for the blue icon for MT5/smiley face for MT4 on your chart before leaving MetaTrader running. If it's missing, permissions have been reset.
- If you're running MetaTrader on a VPS, verify permissions after every scheduled restart. Some Windows Server configurations reset EA settings on reboot.
Summary
Error 4109 (MT4) and its MT5 counterpart error 4752 both mean the same thing: MetaTrader has automated trading switched off. The fix takes about 30 seconds, enable AutoTrading at the terminal level and Allow Live Trading inside the EA properties. Once both are on and you see the blue icon, your PineConnector signals will execute as expected.
Start your free 14-day trial here to automate your TradingView strategies on MT4 or MT5.