To install an MT4 Expert Advisor, place the `.ex4` (or `.mq4`) file in the `MQL4/Experts/` folder inside the MetaTrader 4 Data Directory, then restart the terminal. The whole process takes less than two minutes.
Step-by-Step Installation
Follow these five steps to install any MT4 Expert Advisor correctly.
Step 1. Open the MetaTrader 4 terminal. In the menu, go to File → Open Data Folder.
This opens the MetaTrader 4 User Data Directory in Windows Explorer — the folder where all terminal data (EAs, indicators, scripts, logs) is stored.

Step 2. Open the MQL4 folder.

Step 3. Open the Experts folder inside MQL4.
This is the folder MetaTrader 4 reads at startup to load Expert Advisors.

Step 4. Copy your EA file(s) into the Experts folder:
- The compiled file: `YourEA.ex4` — required to run the EA
- The source file: `YourEA.mq4` — optional; only needed if you plan to edit the code
If the developer included both files, copy both.

Step 5. Restart the MT4 terminal — close it fully and reopen it.
MT4 only loads EA files at startup. Restarting is required for the EA to appear in the Navigator.
That’s all. Your EA is now installed and ready to be used in your charts.
Understanding the File Types
MT4 Expert Advisors use two file extensions:
- `.ex4` — The compiled, executable file. This is what MT4 runs. Always required.
- `.mq4` — The source code. Not needed to run the EA. Useful only if you want to read or modify the code.
If a developer provides only the `.mq4` file, MetaEditor can compile it to `.ex4`: open MetaEditor, load the `.mq4` file, and press F7.
Additional files some EAs require:
- Include files (`.mqh`) → place in `MQL4/Include/`
- Library files (`.ex4`in a Libraries subfolder) → place in `MQL4/Libraries/`
If the EA comes with a subfolder structure, replicate that structure inside `MQL4/Experts/`. When in doubt, ask the developer — a misplaced file is the most common reason an EA fails to load.
Enable AutoTrading After Installation
Placing the files is step one. Before the EA can open trades, AutoTrading must be enabled at the terminal level.
Check the AutoTrading button in the MT4 toolbar. It should be green (active). If it is red, click it once to enable it.
Additionally, when you attach the EA to a chart, its settings panel includes an Allow live trading checkbox. This must also be enabled for automated order placement.
If AutoTrading is off, the EA loads silently but places no orders — no error messages, no indication anything is wrong.
Attach the EA to a Chart
Installing the file makes the EA available in the Navigator panel. To run it, you must attach it to a chart:
- In the Navigator panel (View → Navigator or Ctrl+N), find your EA under Expert Advisors.
- Drag it onto the chart window, or right-click the EA name → Attach to a Chart.
- In the settings window, configure your input parameters and confirm Allow live trading is checked.
- Click OK. The EA name and a smiley face icon appear in the top-right corner of the chart — this confirms it is active.
Each chart window runs one EA instance. To run the same EA on multiple symbols simultaneously, open separate chart windows and attach the EA to each one.
Troubleshooting
EA does not appear in the Navigator after restart
Confirm the file is in `MQL4/Experts/` — not in a subfolder and not in the root MT4 directory. If you have only a `.mq4` file (no `.ex4`), right-click the file in the Navigator → Compile to generate the `.ex4`.
“DLL imports are not allowed” error
Some EAs use external `.dll` files. Go to Tools → Options → Expert Advisors and enable Allow DLL imports. Only enable this for EAs from developers you trust.
Smiley face turns into a sad face after attaching
This means AutoTrading is disabled at the terminal level or Allow live trading was not checked when attaching. Check both settings.
EA compiles but opens no trades
Verify the EA’s logic conditions are met. Many EAs require specific market conditions, trading session hours, or minimum account balance before placing the first order. Check the Experts tab in the terminal for log output.
Frequently Asked Questions
What is the difference between .ex4 and .mq4 files?
The `.ex4` file is the compiled executable — the version MetaTrader 4 runs. The `.mq4` file is the source code. You need `.ex4` to use the EA. The `.mq4` file is optional and only useful if you want to read or modify the logic. If a developer sends only `.mq4`, MetaEditor will compile it to `.ex4` automatically when you open and build the file.
Do I need to restart MT4 after placing the EA file?
Yes. MetaTrader 4 reads the Experts folder at startup. Files placed while the terminal is running will not appear in the Navigator until you restart. Right-clicking the Expert Advisors folder and selecting Refresh sometimes works as an alternative, but a full terminal restart is more reliable.
Can I run the EA without the source code (.mq4)?
Yes. The `.ex4` compiled file is all you need to install and run an Expert Advisor. Source code is not required for execution. Some developers provide it for transparency; others deliver compiled-only builds to protect their intellectual property.
Why is my EA installed but not placing any trades?
The two most common causes: (1) AutoTrading is disabled — the toolbar button should be green, not red; (2) Allow live trading was not checked when attaching the EA to the chart. Verify both. Also check the Experts log tab for any runtime errors or “trade context busy” messages.
Where exactly is the MT4 Data Folder on Windows?
Go to File → Open Data Folder in the MT4 menu. The path is typically:
`C:\Users\[YourName]\AppData\Roaming\MetaQuotes\Terminal\[TerminalID]\`
The `[TerminalID]` is a long hash string — this is normal. Each MT4 installation gets a unique ID.
Installing on MetaTrader 5?
The process is similar but uses different folders (`MQL5/Experts/`) and file extensions (`.ex5` or `.mq5`). See: How to install an Expert Advisor in MetaTrader 5.


Leave a Reply