Master MetaTrader 4/5 AutoTrading: Enable & Troubleshoot

Learn how to enable AutoTrading in MT4/MT5, configure EAs, fix common algo trading failures, and manage algorithmic execution for reliable 24/7 operation.

master-metatrader-4-5-autotrading-enable

Introduction

You've written or purchased a promising Expert Advisor (EA), attached it to a chart, and watched it do nothing. The smiley face is green, but no trades fire. This is the single most common frustration for new algorithmic traders on MetaTrader 4 and MetaTrader 5. The culprit is almost always a misconfigured AutoTrading environment.

This guide walks you through every layer of the AutoTrading stack—from the global platform switch down to EA-specific input validation. By the end, you'll be able to enable automated trading reliably across MT4 and MT5, diagnose why an EA won't trade, and build a checklist that prevents silent failures during live trading or backtesting.

Prerequisites

  • MetaTrader 4 or MetaTrader 5 installed (build 1400+ for MT4, build 4000+ for MT5).
  • A live or demo account funded and connected to a broker that supports algorithmic trading. Most brokers do, but some prop firm accounts restrict EAs.
  • A compiled EA file (.ex4 for MT4, .ex5 for MT5) placed in the correct MQL4/Experts or MQL5/Experts folder. If you're writing your own, the source (.mq4/.mq5) must compile without errors in MetaEditor.
  • Basic familiarity with the MetaTrader chart interface and Navigator panel.

Step-by-Step Instructions

1. Verify the EA Is Properly Installed

  1. Open MetaTrader and press F4 to launch MetaEditor.
  2. In MetaEditor, navigate File → Open Data Folder. This opens the root directory of your MetaTrader installation.
  3. Browse to MQL4/Experts (MT4) or MQL5/Experts (MT5). Your EA's .ex4 or .ex5 file must be here. Subfolders are allowed but can cause visibility issues—keep EAs directly inside the Experts folder.
  4. Press Ctrl+N to open the Navigator panel in the main terminal. Expand Expert Advisors. If your EA appears in the list, installation succeeded.

2. Enable AutoTrading Globally in the Platform

MT4 and MT5 both have a master AutoTrading button. It must be green (enabled) for any EA to trade.

  • MT4: Look for the "AutoTrading" button on the toolbar (a green arrow icon). Click it once to toggle. When enabled, the button glows green and the word "AutoTrading" appears above the chart.
  • MT5: Same location—the toolbar button with a green arrow. Click to enable. A green "AutoTrading" indicator appears in the status bar at the bottom.

If the button is grayed out or clickable but refuses to stay green, check Tools → Options → Expert Advisors (MT4) or Tools → Options → Expert Advisors (MT5). Ensure "Allow Automated Trading" is checked. On MT5, also verify "Allow DLL imports" and "Allow WebRequest for listed URLs" if your EA uses external libraries or HTTP calls.

3. Attach and Configure the EA on a Chart

  1. Drag the EA from the Navigator panel onto any chart. The EA Properties dialog opens.
  2. Go to the Common tab. Check these boxes:
    • "Allow live trading" (this is the per-EA AutoTrading switch).
    • "Allow DLL imports" if your EA uses external functions (e.g., API calls).
    • "Allow import of external experts" (rare, only if the EA calls another EA).
  3. Click OK. The EA attaches to the chart. A smiley face icon appears in the top-right corner of the chart:
    • Green smiley: EA is loaded and ready to trade.
    • Yellow smiley: EA is loaded but AutoTrading is disabled globally or per-chart.
    • Red smiley: EA has errors (check the Experts tab in the Terminal window).

4. Confirm the EA Is Actually Trading

  1. Open the Terminal panel (Ctrl+T) and click the Experts tab.
  2. You should see log entries like:
    2025.01.15 10:30:00.123 'MyEA' loaded successfully
    2025.01.15 10:30:01.456 'MyEA' on EURUSD: trade allowed
  3. If you see AutoTrading disabled or Trade context is busy, revisit steps 2 and 3.
  4. To verify the EA fires a trade, set a minimum volume condition in the EA's inputs (e.g., LotSize=0.01) and run it on a 1-minute chart during active market hours. Manually check if an order appears in the Trade tab.

5. Enable AutoTrading for Backtesting in the Strategy Tester

When using the Strategy Tester (Ctrl+R), the tester simulates its own AutoTrading environment. However, you must still check one setting:

  1. In the Strategy Tester panel, under Settings, ensure "Every tick" or "Control points" modeling mode is selected (not "Open prices only" for most EAs).
  2. Under Expert Advisors (the tab with the EA icon), verify "Allow live trading" is checked. This is the tester's per-EA switch.
  3. Click Start. The tester ignores the global AutoTrading button—it always runs in simulation mode.

Tips and Best Practices from Experience

Use a Dedicated Algo Trading Account

Never run AutoTrading on an account you use for manual trading. EAs can open positions unexpectedly, conflicting with your manual analysis. Open a separate demo or live account specifically for algorithmic strategies.

Always Test with "Allow DLL Imports" Off First

If your EA doesn't need DLLs, leave this unchecked. Malicious EAs can use DLL imports to steal credentials or corrupt your system. Only enable it for EAs from trusted sources that explicitly document the DLL requirement.

Monitor the Experts Tab Daily

The Experts tab is your EA's diary. Check it every morning. Look for recurring errors like OrderSend error 130 (invalid stops) or OrderSend error 138 (requote). These indicate your EA's logic needs adjustment, not a platform issue.

Set Up Email or Push Notifications for EA Status

In Tools → Options → Notifications, enable email or push notifications. Your EA can call SendMail() or SendNotification() to alert you when it opens or closes a trade, or when an error occurs. This is critical for unattended VPS setups.

Use a VPS for 24/7 Operation

Your home PC may reboot, lose internet, or go to sleep. A Virtual Private Server (VPS) running MetaTrader 24/7 ensures your EAs never miss a trading opportunity. Most brokers offer free VPS for accounts with a minimum balance (e.g., $5,000).

Common Mistakes and Troubleshooting

Symptom Likely Cause Fix
Green smiley but no trades EA logic conditions not met, or trade context busy Check the Experts tab for "trade context busy" errors. If none, the EA's entry conditions are too strict—reduce them in inputs or test on a different symbol/timeframe.
AutoTrading button grayed out Account type restricts EAs (e.g., prop firm challenge) Contact your broker. Some accounts require manual trading only. Open a dedicated ECN/STP account.
Yellow smiley on chart Global AutoTrading is disabled Click the AutoTrading button on the toolbar to enable it.
EA not visible in Navigator Wrong folder or EA compiled for wrong platform Move the .ex4/.ex5 file to MQL4/Experts or MQL5/Experts. Refresh Navigator (right-click → Refresh).
"OrderSend error 130" in logs Invalid Stop Loss or Take Profit Ensure SL/TP are within broker limits (e.g., not too close to current price). Adjust EA inputs or add slippage tolerance.

Summary / Recap and Next Steps

You now have a complete, repeatable workflow to enable AutoTrading on MT4 and MT5. The key layers are: install the EA correctly → enable the global AutoTrading button → configure per-EA settings → monitor the Experts tab for errors → and test in the Strategy Tester with the correct modeling mode.

Next steps:

  • Set up a VPS to run your EAs 24/7. Many brokers offer free VPS for accounts above a threshold balance.
  • Learn to read the Experts tab log format: timestamps, error codes, and trade context messages. This is your EA's health monitor.
  • Implement trade-level notifications via SendNotification() in your MQL4/MQL5 code. This alerts you to every trade event on your phone.
  • Explore multi-chart EA setups: you can attach the same EA to multiple symbols/timeframes, but each instance runs independently—plan your risk management accordingly.

Frequently Asked Questions

Why does my EA show a green smiley but never open a trade?

The green smiley only means the EA loaded without compilation errors. Check the Experts tab for "trade context busy" or "OrderSend error" messages. Most often, the EA's entry conditions simply aren't met—reduce the threshold parameters in the EA's inputs and test on a volatile pair like GBPJPY during London session.

Can I run multiple EAs on the same chart in MT4?

No, MT4 allows only one EA per chart. To run multiple EAs simultaneously, attach each to a separate chart. MT5 also enforces one EA per chart. For multi-strategy setups, create a single EA that manages multiple strategies internally.

The AutoTrading button is grayed out and won't click. What's wrong?

This usually means your broker or account type prohibits algorithmic trading. Check with your broker support. Some prop firm challenge accounts explicitly disable EAs. Open a standard ECN or STP account instead.

Does the Strategy Tester respect the global AutoTrading setting?

No. The Strategy Tester runs in an isolated simulation environment and ignores the global AutoTrading button. You only need to check "Allow live trading" in the EA's tester properties. This is a common point of confusion when moving from backtesting to live trading.

Community

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

0 claps0 comments

Related articles