Installing a forex Expert Advisor on MetaTrader 5 takes less than five minutes once you know the correct procedure. This step-by-step tutorial covers every method — from the standard file installation to compiling from MQL5 source — plus the common errors that leave traders staring at a chart with no EA running.
What You Need Before Starting
Before installing an EA, confirm:
- MT5 is installed and connected to a broker account (live or demo). EAs can only run when MT5 is connected to a server.
- You have the EA file — either a compiled
.ex5file (most common from vendors) or a.mq5source file that you'll compile yourself. - You understand which pairs and timeframe the EA is designed for. Installing an EA on the wrong chart is the most common "installation succeeded but nothing happened" problem.
- Your broker allows automated trading. Most brokers do; a few restrict it. Check your broker's terms.
Method 1: Install a .ex5 File (Most Common)
This is how you install purchased or downloaded EAs from most vendors.
Step 1: Open the MT5 Data Folder
In MetaTrader 5, go to: File → Open Data Folder
This opens Windows Explorer to the MT5 data directory. You'll see folders named MQL5, logs, profiles, and others.
Step 2: Navigate to the Experts Folder
Inside the data folder, navigate to:
MQL5 → ExpertsThis is the only folder MT5 reads for Expert Advisors. Files placed anywhere else will not appear in the Navigator.
Step 3: Copy Your .ex5 File
Copy your .ex5 file into the Experts folder. You can paste directly or drag-and-drop.
If your EA came with a data folder (some EAs require additional files like set files, DLLs, or include files), read the vendor's installation instructions carefully. DLL files typically go in MQL5 → Libraries, include files in MQL5 → Include.
Step 4: Refresh the Expert Advisors List in Navigator
Back in MT5, look at the Navigator panel (View → Navigator, or Ctrl+N if it's hidden).
Right-click on Expert Advisors in the Navigator and select Refresh. Your EA should appear in the list.
If it doesn't appear after refreshing, confirm the file is in the correct location: [MT5 Data Folder]\MQL5\Experts\YourEA.ex5.
Step 5: Open the Chart and Attach the EA
Open a chart for the currency pair the EA is designed for:
- File → New Chart or click the symbol in Market Watch
- Set the correct timeframe (check the EA documentation — most scalpers run on M5 or M15, most trend EAs on H1 or H4)
Drag the EA from the Navigator onto the chart. Alternatively, double-click the EA in Navigator.
Step 6: Configure the EA Parameters
A dialog box opens with three tabs:
Common tab:
- Enable "Allow Automated Trading" — this is the most important checkbox. If unchecked, the EA loads but never trades.
- Enable "Allow DLL imports" if the EA uses external DLLs (vendor will specify).
Inputs tab:
- Set the EA's parameters. For your first run, use the vendor's default settings or the provided
.setfile (File → Load → select the .set file).
Dependencies tab:
- Lists required files. Usually you don't need to change anything here.
Click OK. A smiley face icon should appear in the top-right corner of the chart. Green smiley = EA running. Grey smiley = automated trading disabled globally.
Step 7: Enable Automated Trading Globally
Even with the EA configured correctly, MT5 has a global automated trading switch that overrides individual EA settings. Look for the "Algorithmic Trading" button in the toolbar — it should be green/active. If it shows as disabled (red or crossed out), click it to enable.
File → Options → Expert Advisors → Allow Algorithmic Trading also controls this setting.
Method 2: Install from MQL5 Source (.mq5 File)
If you have source code (either written yourself, purchased with source, or from the MQL5 community marketplace), you'll need to compile it.
Step 1: Copy the .mq5 File to the Experts Folder
Same location as above: MQL5 → Experts. Paste the .mq5 source file there.
Step 2: Open MetaEditor
In MT5, press F4 or go to Tools → MetaEditor to open the MQL5 IDE.
Step 3: Open and Compile the EA
In MetaEditor, open the file (File → Open or navigate in the Navigator panel on the left). Once the file is open, press F7 or click Compile in the toolbar.
The Toolbox panel at the bottom shows compilation results. Zero errors = compilation succeeded. Errors mean you need to resolve code issues before the EA can run.
After successful compilation, a .ex5 file is created in the same Experts folder automatically. Switch back to MT5 and refresh the Navigator to see it.
Method 3: Install from MQL5 Marketplace
If you purchased or subscribed to an EA through the official MQL5.com marketplace:
- In MT5, go to Tools → MetaQuotes Software Corp → Market
- Find your purchased EA and click Download
- The EA installs automatically to your MT5 installation
- It appears in Navigator immediately (no manual file copying needed)
Marketplace EAs are often protected and can't be opened in MetaEditor. They run as compiled .ex5 files only.
Method 4: One-Click Install from MQL5.com Website
If you're on the MQL5.com website and click "Open in MetaTrader 5" on an EA page, MT5 must be running. The browser trigger opens MT5 and prompts you to add the EA automatically.
Note: This method requires MT5 to be registered with your MQL5.com account (Tools → Options → Community tab).
Verification: Is the EA Running Correctly?
After installation, verify these five points:
1. Smiley face is green, not grey
Green smiley in the chart's top-right corner = EA running. Grey = automated trading disabled. Click the Algo Trading button in the toolbar to enable.
2. No "Trade context is busy" errors in the Experts tab
Go to View → Terminal → Experts tab. This log shows all EA activity and errors. "Trade context is busy" is normal for a second or two at startup; persistent errors indicate a problem.
3. The EA is showing in the Chart window title
The chart title bar should show the EA name alongside the pair and timeframe: e.g., EURUSD,H1 - MyEA.
4. No "DLL calls are not allowed" error
If you see this in the Experts log, go to the EA's Common tab settings and enable "Allow DLL imports." Some brokers also restrict DLL usage; contact support if enabling DLL imports doesn't resolve it.
5. Inputs match your intended settings
Double-click the smiley face to reopen the EA settings dialog. Verify lot size, stop loss, and take profit are set correctly for your account balance.
Running MT5 on a VPS for 24/7 EA Operation
Your home computer shuts down, loses internet, gets Windows updates. Any of these stops your EA mid-trade. For live EA trading, a dedicated VPS is required — not optional.
A VPS keeps MT5 running 24/7 with professional-grade uptime. For full guidance on selecting the right VPS for your EA type, see Best VPS for Forex EA Trading 2026 — including specific recommendations by latency zone and broker compatibility.
Common Installation Errors and Fixes
EA Not Appearing in Navigator
Cause: File in wrong location, or Navigator not refreshed. Fix: Confirm the file is in [MT5 Data Folder]\MQL5\Experts\. Right-click Expert Advisors in Navigator → Refresh.
"Expert Advisor not allowed" Error
Cause: Broker has blocked automated trading for your account type. Fix: Contact broker support. Most brokers allow EAs; some demo accounts or specific account types have restrictions.
EA Loaded but Not Trading
Cause 1: Global algo trading disabled. Fix: Click the Algorithmic Trading button in toolbar. Cause 2: Automated trading unchecked in EA settings. Fix: Double-click smiley → Common tab → enable "Allow Automated Trading." Cause 3: Wrong timeframe or pair. The EA might have an internal check for its target instrument. Cause 4: EA has a trading session filter. Many EAs only trade during London/NY session.
"Invalid License" or "EA disabled"
Cause: License tied to specific MT5 account number or computer, and you're running on a different account/machine. Fix: Contact vendor with your account number for license transfer or activation.
DLL Error
Cause: EA requires DLL; DLL imports disabled. Fix: In EA settings (Common tab), enable "Allow DLL imports." Copy the DLL file to MQL5\Libraries\ if not already there.
"Trade is disabled" in Experts Log
Cause: Usually a broker-side issue — account not fully verified, or trading suspended. Fix: Log in to broker portal and check account status.
Running Multiple EAs Simultaneously
MT5 allows multiple EAs on different charts simultaneously. Each EA needs its own chart window with the correct pair/timeframe.
Practical considerations:
- Each open chart with an EA consumes system resources (RAM, CPU)
- For more than 3–4 EAs simultaneously, a VPS with at least 4GB RAM is recommended
- Position sizing across multiple EAs requires careful planning to avoid over-leveraging the account collectively
Using Set Files for Parameter Management
Most professional EA vendors provide .set files — parameter presets for specific pairs and conditions. Loading a set file is more reliable than manually entering parameters:
- With the EA settings dialog open, click Load in the Inputs tab
- Navigate to the
.setfile provided by the vendor - Parameters populate automatically
Save your own parameter variations as set files too (click Save in the same dialog). This makes switching between settings on different pairs or account sizes efficient.
Testing the EA Before Going Live
Before running any EA on a live account:
- Demo account test: Run the same EA on a demo account with identical settings for at least 2–4 weeks. Observe entry behavior, lot sizes, and drawdown.
- Strategy Tester backtest: MT5's built-in backtester lets you run the EA against historical data. Use the highest quality tick data available (DUKASCOPY or Tickstory imports for professional-grade accuracy). See the complete MT5 Strategy Tester guide for setup details.
- Small live lot: Start with 0.01 lots on the live account for the first month. Confirm live execution matches demo behavior before scaling.
Frequently Asked Questions
Can I run MT5 EAs on MT4?
No. .ex5 files compiled for MT5 do not run on MT4, and vice versa. If you need an MT4 EA, you need the .ex4 version. Many vendors offer both versions; some products are MT5-only.
Do I need to leave MT5 open for the EA to run?
Yes — MetaTrader 5 must be running for any EA to execute trades. This is why running MT5 on a VPS (rather than your home PC) is essential for live trading. See Best VPS for MT5 EA trading.
Can I run the same EA on multiple accounts simultaneously?
Depends on the license. Most commercial EAs are licensed per MT5 account number. Running on additional accounts typically requires additional licenses. Check the vendor's license terms.
Why isn't my EA placing trades even though it's running?
The most common reasons: market is closed (weekend or holiday), the EA has session-time filters, the spread is above the EA's maximum allowed spread, or the account lacks sufficient margin. Check the Experts tab log for specific messages.
How do I remove an EA from a chart?
Right-click the chart → Expert Advisors → Remove. Or drag a different EA onto the chart to replace it. Or go to Navigator, right-click the running EA and select Remove.
Can I run an AI EA the same way?
Yes — AI-based EAs that run locally in MT5 install identically to traditional EAs. EAs connected to external signal services additionally require configuring the API key or account credentials in the EA's input parameters. See Best AI forex bots 2026 for how these signal-connected EAs work.
This tutorial is for educational purposes. Running automated trading software involves financial risk. Always test EAs on a demo account before deploying on a live account with real capital.
William Harris is the founding editor of Forex Robot Easy. He has spent over a decade building and reviewing algorithmic trading systems on MetaTrader 4 and 5, with a focus on machine learning, walk-forward validation, and execution mechanics.