How to Attach an EA on MT5 — Complete Step-by-Step Guide 2026
So you've downloaded an Expert Advisor (EA) and you're staring at MetaTrader 5 not knowing what to do next. Don't worry — attaching an EA on MT5 is simpler than it looks, and this guide walks you through every single step from zero to fully automated trading.
Whether you're setting up a gold trading bot, a scalping EA, or any other automated system — this is the only guide you need.
What Is an EA on MT5?
An Expert Advisor (EA) is automated trading software that runs directly inside MetaTrader 5. It analyzes the market, identifies setups based on its programmed strategy, and executes trades automatically — entries, stop losses, take profits — without you touching a single button.
Once attached and running, an EA works 24 hours a day, 5 days a week. It never sleeps, never panics, and never breaks its own rules.
What You Need Before Starting
Make sure you have these ready before following the steps below:
- ✅ MetaTrader 5 installed on your PC (downloaded from your broker's website)
- ✅ Your EA file — it will end in
.ex5(for MT5) - ✅ A set file if your EA developer provided one (ends in
.set) - ✅ Your MT5 account logged in and connected to your broker
⚠️ Important: MT5 only accepts
.ex5files. If your file ends in.ex4that is an MT4 file and will not work on MT5. Make sure you have the correct version before proceeding.
Step 1 — Open the MT5 Data Folder
This is where MT5 reads all EA files from. You must place your EA in the exact correct folder or it will never appear inside the platform.
- Open your MetaTrader 5 platform
- Click "File" in the top menu bar
- Click "Open Data Folder"
- A Windows Explorer window will open — this is your MT5 Data Folder
💡 Note: The Data Folder is different from where MT5 is installed on your PC. Always use File → Open Data Folder to find the correct location. This is where most beginners go wrong.
Step 2 — Place Your EA File in the Correct Folder
Inside the Data Folder you just opened:
- Open the "MQL5" folder
- Open the "Experts" folder inside MQL5
-
Copy and paste your
.ex5EA file into this Experts folder - Close the folder window
Your full folder path will look something like this:
C:\Users\YourName\AppData\Roaming\MetaQuotes\Terminal\[ID]\MQL5\Experts\YourEA.ex5
Step 3 — Refresh the Navigator Panel
MT5 will not automatically detect your new file. You need to manually refresh it.
- In MT5, open the Navigator panel — press Ctrl + N if it is not visible
- Find "Expert Advisors" in the Navigator list
- Right-click on "Expert Advisors"
- Click "Refresh"
- Your EA should now appear in the list
💡 If your EA still does not appear after refreshing, completely close and reopen MT5. This solves the issue almost every time.
Step 4 — Enable AutoTrading in MT5
This is the most commonly missed step. Without this, your EA will sit on the chart but will never place a single trade.
Enable from toolbar:
- Look at the top toolbar in MT5
- Find the "AutoTrading" button
- Click it until it turns green
- Green = ON / Red = OFF
Enable from settings:
- Go to Tools → Options
- Click the "Expert Advisors" tab
- Check "Allow automated trading"
- Check "Allow DLL imports"
- Click OK
⚠️ If the AutoTrading button is red, your EA will never trade — no matter how perfectly everything else is set up. Always check this first.
Step 5 — Open the Correct Chart
Your EA must be attached to the right symbol and timeframe. This step is critical for gold trading EAs.
- Press Ctrl + M to open Market Watch
- Find XAUUSD in the list
- Right-click XAUUSD → select "Chart Window"
- A new XAUUSD chart opens
- Set the timeframe to M15 (15 minutes) — this is the optimal timeframe for most gold EAs
💡 Broker Symbol Note: Some brokers add suffixes to symbols. Your broker may show Gold as XAUUSDm, XAUUSD.pro, or XAUUSD-ecn instead of just XAUUSD. If you cannot find XAUUSD in Market Watch, right-click anywhere in Market Watch → click "Symbols" → find Gold and click "Show." Always use the exact symbol your broker provides.
Step 6 — Attach the EA to the Chart
Now the easy part:
Method 1 — Drag and Drop:
- In the Navigator panel, find your EA under "Expert Advisors"
- Click and drag it directly onto your XAUUSD chart
- Release — the Properties window will appear
Method 2 — Double Click:
- Make sure your XAUUSD chart is the active window
- Double-click your EA in the Navigator
- It attaches automatically to the active chart
Step 7 — Configure EA Settings (Properties Window)
After attaching, a popup window appears with multiple tabs. Here is exactly what to do:
"Common" Tab
- ✅ Check "Allow Algo Trading" — this is mandatory, without it the EA cannot trade
- ✅ Check "Allow modification of signal settings" if it appears
"Inputs" Tab
This is where your EA parameters live — lot size, risk percentage, stop loss distance, take profit, and more.
- If your developer gave you a set file — do NOT change anything here yet. Go to Step 8 first.
- If you are setting parameters manually — enter the values your developer recommends
Click OK
Your EA is now attached. You will see:
- ✅ EA name in the top-right corner of the chart
- ✅ A green smiley face icon — this means it is active and ready to trade
- ❌ A grey smiley face — this means something is wrong. Go back and check AutoTrading and Allow Algo Trading
Step 8 — How to Import a Set File
If your EA developer gave you a .set file, this contains pre-optimized settings built specifically for that EA's strategy. Always use it instead of manually entering parameters — it makes a huge difference in performance.
Here's exactly how to import it:
- Attach your EA to the chart (Steps 6 & 7 above)
- When the Properties window opens, click the "Inputs" tab
- Click the "Load" button at the bottom of the window
- Browse to the folder where you saved your
.setfile - Select it and click Open
- All input values will automatically populate
- Click OK
💡 For Dude's Algo Pro users: The EA comes with 10 different set files — each pre-optimized for a different risk level and account size. Always load the correct set file for your account before going live. If you are unsure which one to use, contact support at trading-dude.com and the team will guide you.
Step 9 — Verify the EA Is Running Correctly
After attaching, do a quick health check before leaving it to run:
On the Chart:
- ✅ EA name visible in top-right corner of chart
- ✅ Green smiley face icon showing
- ✅ AutoTrading button is GREEN in the toolbar
In the Journal Tab:
- Look at the bottom panel of MT5
- Click the "Journal" tab
- You should see log entries showing your EA has initialized successfully
- No red error messages should appear
In the Experts Tab:
- Click the "Experts" tab at the bottom panel
- Any EA activity — trades opened, closed, or errors — will appear here in real time
- This is your main monitoring window
Common Errors and Exact Fixes
These are the problems traders face most often — and exactly how to solve them:
| Problem | Most Likely Cause | Fix |
|---|---|---|
| Grey smiley face on chart | AutoTrading is disabled | Click AutoTrading button — make it GREEN |
| EA attached but not trading | "Allow Algo Trading" unchecked | Reattach EA → check Allow Algo Trading in Common tab |
| EA not visible in Navigator | File placed in wrong folder | Move .ex5 to MQL5 → Experts folder → Refresh Navigator |
| "Invalid symbol" error | Wrong symbol name for your broker | Check exact symbol name in Market Watch (e.g. XAUUSDm) |
| DLL error on startup | DLL imports blocked | Tools → Options → Expert Advisors → check Allow DLL imports |
| EA stops working overnight | No VPS running | Set up a VPS — see full guide below |
| EA runs on demo but not live | Separate login needed | Log into your live account in MT5, reattach EA |
Why You Absolutely Need a VPS
This is the step most traders skip — and then wonder why their bot missed the entire London session.
What is a VPS? A VPS (Virtual Private Server) is a remote computer that runs 24 hours a day, 7 days a week. You install MT5 on this remote computer, attach your EA, and it trades continuously — even when your own PC is off, sleeping, or has no internet.
Why it matters for gold trading specifically: Gold's biggest and most consistent moves happen during two windows:
- London Open — 8:00 AM to 12:00 PM UK time
- New York Session — 1:00 PM to 5:00 PM UK time
If your PC goes to sleep or your internet drops during these windows, your EA misses the best setups of the entire day. Worse — if you have an open trade and MT5 closes, your stop loss and take profit are no longer being managed.
How to set up a VPS in 5 steps:
- Choose a VPS provider — Contabo, ForexVPS, or MetaTrader's built-in VPS are reliable options
- Select a Windows VPS with at least 2GB RAM — MT5 is lightweight and runs smoothly
- Choose a server location closest to your broker's server — lower ping means faster trade execution
- Install MT5 on the VPS using your broker's download link
- Log into your MT5 account on the VPS and repeat Steps 1–9 from this guide
Once set up, your EA runs permanently on the VPS. You can close your own laptop completely and your bot keeps trading without interruption.
💡 Cost: A basic VPS costs $5–$15 per month. For any gold trader running an EA, this is the single most important investment you can make after the EA itself.
How to Remove or Pause an EA
To temporarily pause the EA:
- Click the AutoTrading button to turn it red
- EA freezes but stays attached to the chart
- Click green again to resume
To completely remove the EA:
- Right-click anywhere on the chart
- Hover over "Expert Advisors"
- Click "Remove"
- EA is fully detached — chart returns to manual mode
Ready to Run a Gold EA on MT5?
You now know exactly how to attach, configure, and run any EA on MetaTrader 5. The setup process takes less than 10 minutes once you have done it once.
If you are looking for a reliable, purpose-built gold EA to attach — Dude's Algo Pro is built specifically for XAUUSD on MT5 with everything pre-configured:
- 🔌 Plug and play setup — follow this guide once, load the set file, and you're live
- 📁 10 optimized set files included — one for every risk level and account size
- 🛡️ Hard stop loss on every single trade — zero martingale, zero blowup risk
- 📊 80% backtested win rate on XAUUSD M15 timeframe
- 💬 Full setup support included — real help if you get stuck at any step
- 👥 100+ active traders running it live across Pakistan, Middle East, and globally
No complicated configuration. No guessing. Just load the set file, attach it using this guide, and let it run.
→ Learn more about Dude's Algo Pro — trading-dude.com
Final Checklist Before Going Live
Run through this before leaving your EA to trade unsupervised:
- ☐
.ex5file placed in MQL5 → Experts folder - ☐ Navigator refreshed — EA visible in list
- ☐ AutoTrading button is GREEN
- ☐ "Allow automated trading" enabled in Tools → Options
- ☐ "Allow DLL imports" enabled in Tools → Options
- ☐ EA attached to correct symbol and timeframe (XAUUSD M15)
- ☐ "Allow Algo Trading" checked in Common tab
- ☐ Set file loaded correctly in Inputs tab
- ☐ Green smiley face visible on chart
- ☐ Journal tab shows no errors
- ☐ VPS set up for 24/5 uninterrupted operation
Everything ticked? Your EA is live and trading. 🚀