Master MetaTrader 4/5 Automated Trading Permissions

Learn how to enable and configure all MetaTrader permissions for EAs: AutoTrading button, DLL imports, alerts, and algorithm trading settings.

master-metatrader-4-5-automated-trading

Every MetaTrader user who runs an Expert Advisor (EA) eventually hits the same wall: the EA attaches to a chart but nothing happens. The smiley face is gray, trades don't fire, or you get a mysterious "Expert Advisor disabled" message. Nine times out of ten, the culprit is a permissions or platform setting, not a bug in your code.

This guide walks you through every permission layer in MetaTrader 4 and MetaTrader 5 that controls whether an EA can run, trade, import external libraries, and send alerts. By the end, you'll know exactly which buttons to click, which menu items to check, and which settings to verify when an EA refuses to execute.

Why EA Permissions Matter

MetaTrader has a multi-layered permission system for a good reason: security. A rogue EA with full DLL access could read your file system, send data to remote servers, or manipulate your account balance. The platform lets you grant permissions granularly so you can trust your own code while blocking untested third-party EAs.

Missing any one of these layers will silently prevent your EA from trading. The most common scenario: you compile an EA, drag it onto a chart, see the smiley face, but no trades appear. You check the Experts tab in the Terminal window and see "AutoTrading disabled" or "DLL imports not allowed." Each message points to a specific permission you need to enable.

Prerequisites

  • MetaTrader 4 build 1400+ or MetaTrader 5 build 4000+ – older builds have slightly different menu layouts, but the concepts are the same.
  • An installed EA or indicator – you can use the built-in Moving Average EA for testing, or any custom EA you've compiled.
  • A demo account – never test permissions on a live account first. Demo accounts replicate all permission settings exactly.
  • Administrator rights on your computer – some permission changes require writing to the MetaTrader configuration files.

Step-by-Step Permission Configuration

Step 1: Enable AutoTrading Globally

This is the master switch. If it's off, no EA can trade on any chart.

  1. Open MetaTrader 4 or 5.
  2. Look at the toolbar just above the main chart area. You'll see a green triangle button labeled AutoTrading (in MT4) or a button with a green arrow and the text Algo Trading (in MT5).
  3. Click it so the button becomes highlighted or shows a green background. In MT4, the button text changes from "AutoTrading" to "AutoTrading On" or a green arrow appears next to it.
  4. Verify the change in the Terminal window (Ctrl+T) under the Experts tab. You should see a message like "AutoTrading is enabled."

MT4 vs MT5 difference: In MT4, the AutoTrading button is in the top toolbar. In MT5, it's labeled "Algo Trading" and located in the same spot. Both perform the same function.

Step 2: Enable AutoTrading for the Specific Chart

Even with the global switch on, each chart has its own EA trading permission.

  1. Right-click on the chart where you've attached the EA.
  2. Select Expert Advisors > Properties (or press F7 with the chart active).
  3. Go to the Common tab.
  4. Check the box labeled Allow live trading.
  5. Optionally check Allow DLL imports if your EA uses external libraries (more on this in Step 4).
  6. Click OK.

If you skip this step, the EA will attach to the chart and show a smiley face, but it will never execute a trade. The smiley face will have a small arrow or exclamation mark indicating limited permissions.

Step 3: Enable Algorithmic Trading in MT5

MetaTrader 5 has an additional permission layer that MT4 does not. In MT5, even with AutoTrading enabled, the platform can block algorithmic trading at the account level.

  1. Go to Tools > Options (or press Ctrl+O).
  2. Click the Expert Advisors tab.
  3. Check the box Allow algorithmic trading.
  4. Also check Allow DLL imports and Allow WebRequest for listed URLs if your EA needs internet access.
  5. Click OK.

In MT4, the Options dialog has a similar Expert Advisors tab, but it only controls DLL and WebRequest permissions, not a separate algorithmic trading toggle.

Step 4: Configure DLL Import Permissions

Many advanced EAs use DLL files for extended functionality: connecting to external APIs, reading hardware information, or performing complex mathematical calculations. MetaTrader blocks DLL imports by default for security.

  1. Open the EA's properties (F7 on the chart).
  2. Go to the Common tab.
  3. Check Allow DLL imports.
  4. Go to Tools > Options > Expert Advisors tab.
  5. Under Allow DLL imports, you have two choices:
    • For all EAs – convenient but less secure.
    • For listed EAs only – you can specify which EAs are allowed to import DLLs by their file names.
  6. Click OK.

Security tip: Never enable DLL imports globally on a live account unless you trust every EA you run. A malicious DLL can read your account password from memory or send trade signals to a remote server.

Step 5: Configure WebRequest Permissions

If your EA needs to fetch data from the internet – for example, economic calendar events, news sentiment, or external price feeds – it requires WebRequest permission.

  1. Go to Tools > Options > Expert Advisors tab.
  2. Check Allow WebRequest for listed URLs.
  3. In the text box below, add the URLs your EA needs to access, one per line. For example:
    https://www.forexfactory.com
    https://api.example.com
  4. Click OK.

Your EA must also include the #property strict directive and use the WebRequest() function correctly. If you get error 4060 (WebRequest failed), it's almost always a missing or incorrect URL in this list.

Step 6: Verify Permission Status in the Terminal

After configuring everything, confirm the EA is fully enabled.

  1. Open the Terminal window (Ctrl+T).
  2. Click the Experts tab.
  3. Look for the line corresponding to your EA. It should show:
    • A green checkmark or smiley face with no exclamation marks.
    • A message like "Expert Advisor initialized successfully."
    • No red error messages about permissions.
  4. If you see "AutoTrading disabled by server" or "Trading disabled by server," contact your broker – they may have disabled algorithmic trading on your account type.

Permission Settings Reference Table

Permission MT4 Location MT5 Location Default
Global AutoTrading Toolbar button Toolbar button (Algo Trading) Disabled
Chart-level live trading EA Properties > Common EA Properties > Common Enabled (if global on)
Algorithmic trading Not present Tools > Options > Expert Advisors Disabled
DLL imports Tools > Options > Expert Advisors Tools > Options > Expert Advisors Disabled
WebRequest Tools > Options > Expert Advisors Tools > Options > Expert Advisors Disabled

Tips and Best Practices from Experience

  • Create a permission checklist – Before deploying any EA, run through this checklist: global AutoTrading on, chart-level live trading allowed, algorithmic trading enabled (MT5 only), DLL imports allowed if needed, WebRequest URLs configured if needed. One missed checkbox can cost hours of debugging.
  • Test permissions in the Strategy Tester first – The Strategy Tester simulates all permission settings. If your EA trades correctly in the tester but not live, the issue is almost certainly a permission or environment setting.
  • Use separate demo accounts for testing untrusted EAs – Never grant DLL or WebRequest permissions to an EA you didn't write yourself without thoroughly auditing the code. Even popular free EAs can contain hidden malicious functions.
  • Restart MetaTrader after changing permissions – Some permission changes, especially DLL import lists, only take effect after a full platform restart. If the EA still doesn't work after enabling permissions, close and reopen MT4/MT5.
  • Check the broker's server-side restrictions – Some brokers disable algorithmic trading on certain account types (e.g., Islamic accounts or micro accounts). If you see "AutoTrading disabled by server" in the Experts tab, contact your broker's support.

Common Mistakes and Troubleshooting

Mistake 1: Enabling Global AutoTrading but Forgetting Chart-Level Permission

Symptom: The EA attaches to the chart, shows a smiley face, but never trades. The Experts tab shows "Expert Advisor initialized" with no errors.

Fix: Right-click the chart, select Expert Advisors > Properties > Common tab, and check "Allow live trading."

Mistake 2: DLL Imports Enabled Globally but Not in EA Properties

Symptom: The EA compiles without errors but fails to load. The Experts tab shows "Cannot load DLL 'example.dll' – error 126."

Fix: Open the EA's properties (F7), go to the Common tab, and check "Allow DLL imports." Also verify the DLL file exists in the MQL4\Libraries or MQL5\Libraries folder.

Mistake 3: WebRequest URL Not Added to the Allowed List

Symptom: The EA runs but the Experts tab shows "WebRequest failed, error 4060."

Fix: Go to Tools > Options > Expert Advisors, check "Allow WebRequest for listed URLs," and add the exact URL (including https://) your EA is trying to access.

Mistake 4: MT5 Algorithmic Trading Toggle Disabled

Community

Clap for the article and open comments only when you want to read them.

0 claps0 comments

Related articles