You found a promising free expert advisor in our curated library — now what? This guide walks you through every way to get an EA running in MetaTrader 5, the settings people miss, and the two-minute backtest that should always come before live money. Total time: about two minutes once you've done it once. Not sure which platform runs what? The MT4 vs MT5 comparison settles it in five minutes.
Before you start (30 seconds)
- Your EA file ends in .mq5 (source code) or .ex5 (compiled). Both install the same way. Got a .mq4/.ex4? That's MT4 — different language, see the FAQ.
- Get files from the official MQL5 Code Base or a source you trust. Random “free EA” sites and Telegram channels are the #1 way traders install malware on purpose.
- You're on a demo account first. Non-negotiable. Every new EA runs on demo for 2–4 weeks minimum — that's our library policy and it should be yours.
Method 1: The data folder (works for any EA)
- Open MetaTrader 5 → menu File → Open Data Folder. A Windows Explorer window opens. C:\Users\[You]\AppData\Roaming\MetaQuotes\Terminal\[ID]\
- Navigate to the Experts folder: open MQL5 → Experts. This is where EAs live. (Indicators go in MQL5 → Indicators; scripts in MQL5 → Scripts.)
- Copy the EA file (.mq5 or .ex5) into that folder. Organizing into subfolders is fine — they'll show as folders in the Navigator.
- Refresh: back in MT5, right-click inside the Navigator panel (Ctrl+N if hidden) → Refresh. If it doesn't appear, restart the terminal.
- Attach it: open a chart (e.g., EURUSD M15), find the EA under Navigator → Expert Advisors, and drag it onto the chart.
- Enable trading: in the settings dialog, tick “Allow Algo Trading”, check the Inputs tab look sane, click OK. Then confirm the Algo Trading toolbar button is green (it's red/off by default after updates).
Method 2: Straight from the Code Base tab (easiest)
- In MT5, open the Toolbox (Ctrl+T) → Code Base tab. This streams the official MQL5 Code Base right into the terminal.
- Browse or search (e.g., “moving average EA”), right-click the item → Download. MT5 compiles and installs it into the right folder automatically.
- Find it in Navigator → Expert Advisors → drag onto a chart as in Method 1, step 5–6.
Pro tip: the same trick works for indicators and the MQL5 Market tab (paid products) — downloads there are licensed to your machine and update automatically.
First-run checklist (the settings people miss)
| Check | Where | Why it matters |
|---|---|---|
| Algo Trading button is green | Toolbar | Global kill-switch — red means no EA can trade, whatever its settings say |
| “Allow Algo Trading” ticked | EA dialog, Common tab | Per-chart permission; silently off after some updates |
| Symbol shows trade prices | Market Watch → right-click → show/tick symbol | An EA on an unlisted symbol just idles |
| AutoTrading icon in chart corner (not gray) | Top-right of chart | Gray = blocked at terminal or chart level |
| Journal shows no red errors | Toolbox → Journal / Experts tabs | “Cannot open file”, “invalid volume”, “market closed” are all here |
| Correct magic number | EA Inputs | Running 2 EAs on one account? Distinct magic numbers stop them fighting over positions |
Backtest before you risk a cent (2 minutes)
- Press Ctrl+R (or View → Strategy Tester). Choose your EA, symbol, timeframe and date range — test at least 12 months.
- Model: pick “Every tick based on real ticks” where available. Slower, but the only honest simulation.
- Press Start, then read the numbers that actually matter:
- Then forward-test on demo for 2–4 weeks — backtests flatter everything; live conditions humble it.
Troubleshooting
| Symptom | Likely cause → fix |
|---|---|
| EA missing from Navigator | Wrong folder (check MQL5 → Experts, not MQL5 → Include) or didn't refresh/restart. .mq5 files must compile — open in MetaEditor (F4) and press F7 if needed. |
| EA name in chart corner is gray | Algo Trading button off (toolbar) or “Allow Algo Trading” unticked in the EA dialog. |
| “Invalid volume” in Journal | Lot size outside the symbol's min/step — e.g., 0.05 on a symbol stepping 0.1. Check right-click symbol → Specification. |
| EA attached but never trades | Symbol not shown in Market Watch · trading closed (weekend) · EA's own conditions simply not met (normal!) · or it requires a specific account type. |
| “This product is not for your account” | MQL5 Market items are rented per-account/machine — activate from the Market tab while logged into the same MQL5 account. |
| Works manually, stops overnight | PC slept or terminal closed. That's what a VPS is for — but only after a strategy proves itself (see our VPS guide, Month 6). |
Frequently asked questions — How to Install an EA in MT5
Can I install MT4 indicators or EAs in MT5?
No — .mq4/.ex4 files don't run in MT5; the languages differ. Most popular MT4 tools have MT5 ports on the MQL5 Code Base, and our library flags which platform each tool is for.
Where did my EA go after a MetaTrader update?
Updates occasionally reset the Algo Trading permission (button turns red). The files stay put in the data folder — just re-enable algo trading and re-attach if needed.
Can I run two EAs on the same account?
Yes, on different charts — but give each a distinct magic number (in Inputs) so their trade management doesn't collide, and make sure their combined risk stays within your 1–2% total.
Do EAs keep running when I close MT5?
No — the terminal must be open and connected. That's why live EA traders rent a VPS (~$10–30/month). On demo? Just leave your PC on; don't pay for a VPS yet.
Continue learning — How to Install an EA in MT5
Sources & further reading — How to Install an EA in MT5
Independent references consulted while writing this guide. PipAtlas is educational and not investment advice - verify anything trade-critical with your broker and the source documents.
- MQL5 - official documentation - EA files, folders and testing workflow straight from MetaQuotes.
- NFA - investor publications - what to verify before trusting any automated system.