Table of Contents
- What Is an Expert Advisor and How MT5 Runs It
- How to Install Expert Advisors on MT5: Step-by-Step
- How to Backtest EAs on MT5 Before Going Live
- Troubleshooting MT5 Expert Advisors: Common Errors
- Security, Permissions, and VPS Setup for 24/7 EA Trading
- Best Practices for EA Trading and Updating Systems
- Frequently Asked Questions
Last Updated: September 16, 2026
What Is an Expert Advisor and How MT5 Runs It
An Expert Advisor is an automated trading program written in MQL5 that runs inside the MetaTrader 5 terminal, executing buy and sell orders according to coded rules without manual input. Each EA is compiled into an .ex5 file and stored in a specific folder on your machine, which is why knowing the file directory matters before anything else. (Source: official MetaQuotes documentation)
MT5 reads these programs from its own data folder, not from wherever you happened to download them. Drop an EA in the wrong place and the Navigator window will never show it. This is the single most common reason traders think a system is broken when it isn’t.
That distinction shapes everything below. At EZMT5, we supply 11 fully built MT5 trading systems, and the setup is the same whether you’re running ours or any other EA: file in the right folder, compiled, attached, algo trading enabled. Get those four steps right and automated trading works. Skip one and nothing fires.
The data folder, not your Downloads folder, is the only location MT5 scans for Expert Advisors. Confirm the path before you troubleshoot anything else.
How to Install Expert Advisors on MT5: Step-by-Step
Installing an EA on MT5 takes about five minutes once you know the path. The process has three stages: locate the data folder, place and compile the file, then attach it to a chart with automated trading switched on.
Here’s the full sequence.
Step 1: Open the MQL5 Data Folder
Open MT5, then go to File > Open Data Folder. This opens your terminal’s data directory in Windows Explorer. Inside it you’ll find a MQL5 folder, and inside that an Experts folder. That Experts directory is where every EA must live.
A common mistake is pasting the .ex5 file into the MT5 installation directory (usually under Program Files) instead of the data folder. They are different locations. Only the data folder works.
Step 2: Place the EA File and Compile It
Copy your .ex5 file into MQL5\Experts. If you received source code as an .mq5 file instead, place it there too, then open MetaEditor, load the file, and press Compile. Compilation generates the .ex5 that MT5 actually executes.
If the EA ships with .set files for input parameters, keep them handy. You’ll load them when you attach the EA.

Step 3: Attach the EA and Enable Algo Trading
Restart MT5 or right-click in the Navigator window and select Refresh. Your EA should now appear under Expert Advisors. Drag it onto a chart window, confirm the input parameters in the dialog, and click OK.
Then look at the toolbar. The Algo Trading button must be green. If it’s red, the EA is loaded but will not execute. Right-click the chart and check that “Allow Algo Trading” is enabled in the Expert Advisors tab.
If the Algo Trading button is off, the EA loads and shows a smiley face on the chart but places zero trades. Traders lose hours chasing this. Check the button first.
| Stage | Action | Where | Time |
|---|---|---|---|
| 1 | Open data folder | File menu | 30 seconds |
| 2 | Place .ex5 file |
MQL5\Experts |
1 minute |
| 3 | Compile source | MetaEditor | 1 minute |
| 4 | Refresh Navigator | Navigator window | 15 seconds |
| 5 | Attach to chart | Chart window | 1 minute |
| 6 | Enable Algo Trading | Toolbar button | 15 seconds |
How to Backtest EAs on MT5 Before Going Live
Backtesting runs your EA against historical price data in the Strategy Tester, showing how the logic would have performed before you risk real capital (How To Backtest An MT5 Expert Advisor Properly – Trading Systems – 12 August 2026). It is not a guarantee of future results, but it exposes broken logic fast.
Open the Strategy Tester with Ctrl+R, select your EA, choose a symbol and timeframe, pick a date range, and run. Start with “Every tick” modeling for accuracy, then move to faster modes once you’re satisfied the logic is sound.
The gap most traders miss: backtesting and forward testing answer different questions. A backtest validates the rules against the past. Forward testing on a demo account validates execution against live spreads, slippage, and latency. Run both. An EA that shines in the Strategy Tester and stumbles on a live account usually failed because of execution conditions the tester can’t fully reproduce.
Check the Journal and Experts tabs after every run. They log every order, rejection, and error.
Troubleshooting MT5 Expert Advisors: Common Errors
Most EA failures trace back to a handful of fixable causes. The Journal tab tells you which one you’re facing, so read it before changing anything.
- EA missing from Navigator: file is in the wrong folder, or you haven’t refreshed.
The Experts tab logs EA-specific messages that the Journal tab doesn’t. When an EA loads but stays silent, the Experts tab usually names the exact reason.
Security, Permissions, and VPS Setup for 24/7 EA Trading
Most installation guides stop the moment the EA appears on a chart.
Understanding MT5 Permission Settings
- Allow Algo Trading, the master switch. Nothing executes without it, regardless of chart-level settings.
- Allow DLL imports, lets an EA call external Windows libraries. Legitimate EAs use this for advanced math, encryption, or broker APIs. Malicious EAs use it to read files, phone home, or interfere with your system. Leave it off unless the EA’s documentation explicitly requires it.
- Allow WebRequest for listed URLs, permits the EA to fetch data from specific web addresses you whitelist. News filters, sentiment feeds, and economic-calendar EAs commonly need this. Add only the exact URLs the provider lists.
- Allow modification of Signal settings, rarely needed; only enable if you use the Signals service and the EA is designed to manage it.
- Allow automated trading on the chart, a per-chart override in the Expert Advisors tab of the chart properties dialog. Even with the global switch on, a chart can block execution.
Verifying Third-Party EA Safety
DLL imports give a program the same file and network access your user account has. Enable it only for EA files from a source you would trust with your brokerage credentials.
VPS Setup for Continuous Execution
What a VPS actually buys you:
- Uptime. The terminal runs through outages that would otherwise stall open positions.
- Lower latency. Choosing a VPS in the same region as your broker’s servers cuts the round-trip time between your order and the matching engine, meaningful for scalping and news strategies.
- Consistency. No more restarting MT5 every morning to reattach charts.
What it costs you:
- Monthly fees. Entry-level Windows VPS plans typically run in the range of a few dollars to a few tens of dollars per month, scaling with CPU, RAM, and proximity to your broker.
- Setup effort. You install MT5 on the remote machine, log in to your broker, reattach EAs, and re-enable Algo Trading. It is a one-time task, but it is a task.
- A second environment to maintain. Updates, backups, and license activations now happen in two places.
Pick a VPS region close to your broker’s trade servers, not close to your home. Latency to the broker is what matters, not latency to you.
Best Practices for EA Trading and Updating Systems
Treat an EA as a system to maintain, not a set-and-forget button.
Core Operating Habits
- Start on demo. Confirm the EA behaves as expected for a reasonable period before committing live capital.
- Size positions within a written risk plan. An EA will happily execute whatever logic it was coded with, including logic that is wrong for your account size.
- Diversify across strategies. Leaning on a single logic path concentrates risk in one market regime.
- Watch the logs. A healthy EA produces clean Journal entries.
How to Update an EA Without Losing Your Setup
Before you touch anything:
Replacing the file:
After the swap:
Never overwrite a running EA file. Remove it from the chart, back up the old `.ex5` and `.set`, then install the new build and reload your saved inputs. Rollback is only possible if you planned for it.
Keeping Multiple EAs From Colliding
If you run more than one EA on the same account, each one needs a unique magic number, the integer MT5 uses to tag orders as belonging to a specific program.
Frequently Asked Questions
Where do I place EA files in the MT5 data folder?
Open MT5, click File, then Open Data Folder. Inside the MQL5 folder, open Experts and copy your .ex5 file there. If you only have a .mq5 source file, place it in the same folder and compile it in MetaEditor. Restart MT5 or right-click the Navigator window and select Refresh so the new expert advisor appears under Expert Advisors.
Why is my Expert Advisor not working on MT5?
The most common causes are that Algo Trading is turned off, the EA is not attached to a chart, or the smiley face icon in the top-right corner is missing. Check the Journal and Experts tabs for error messages. Also confirm your broker allows automated trading and that your account type supports it. If DLL imports are blocked, enable them in Tools > Options > Expert Advisors.
How do I backtest an Expert Advisor on MT5?
Open the Strategy Tester from the View menu, select your EA, choose a symbol and timeframe, and pick a modeling mode. Use Every Tick Based on Real Ticks for the most accurate results. Set your date range, deposit, and input parameters, then click Start. Review the report for profit factor, drawdown, and trade count before running the EA on a demo account.
Which brokers allow EA trading on MT5?
Most major MT5 brokers allow Expert Advisors on standard and ECN accounts, but some restrict them on certain account types or during specific market conditions. Check your broker’s terms or contact support to confirm. If you plan to run EAs 24/7, ask whether they offer a VPS or allow third-party VPS connections, since some brokers require whitelisting.

