Installing an Expert Advisor in MetaTrader 4 takes about two minutes. You copy a file into a folder, attach it to a chart, and turn on auto trading. That's it. The rest of this guide covers each step in detail, plus a troubleshooting section at the end for when things go wrong.
What you need
- MetaTrader 4 installed on your computer (Windows)
- An EA file — either
.ex4(compiled, ready to run) or.mq4(source code) - A trading account connected to MT4, demo or live
MT4 runs .ex4 files. If you only have the .mq4 source, MT4 compiles it automatically when you drop it in the right folder. Most EA providers ship the .ex4 version. If you're not sure what these file types mean, our MT5 installation guide has a more detailed breakdown that applies to MT4 as well.
Step 1: open the data folder
In MetaTrader 4, go to File > Open Data Folder. A Windows Explorer window opens at something like:
C:\Users\YourName\AppData\Roaming\MetaQuotes\Terminal\[long hex string]\
Don't bother memorizing this path. The menu shortcut gets you there.
Step 2: find the Experts folder
Inside the data folder, open:
MQL4 > Experts
This is where EAs live. You might see some files already here — brokers sometimes include sample EAs.
Step 3: drop the file in
Copy your .ex4 file into MQL4\Experts. Done.
If the EA came with extra files, here's where they go:
| File type | Location |
|---|---|
.ex4 or .mq4 | MQL4\Experts |
.dll | MQL4\Libraries |
.set | MQL4\Presets |
.mqh | MQL4\Include |
Got a single .ex4 file and nothing else? Just drop it in Experts and move on.
Step 4: refresh MT4
Back in MetaTrader 4, right-click "Expert Advisors" in the Navigator panel and hit Refresh. Your EA should appear in the list.
Navigator not visible? Press Ctrl+N.
If it still doesn't show up, restart MT4.
Step 5: attach the EA to a chart
Open a chart matching your EA's symbol and timeframe. If the EA trades EURUSD on H1, open an EURUSD H1 chart.
Drag the EA from the Navigator panel onto the chart. A settings window pops up.
Step 6: configure settings
Two tabs matter:
Common tab — Check "Allow live trading." Without this, the EA can't place orders. Check "Allow DLL imports" only if the EA's documentation specifically says so.
Inputs tab — Lot size, stop loss, take profit, indicator settings. If you got a .set file from the provider, click Load and select it. Otherwise, the defaults are usually fine to start with. Read our EA parameter guide before changing things you don't understand.
Click OK.
Step 7: check it's working
Look at the top-right corner of the chart. You want to see a smiley face next to the EA name. Smiley = active.
Frowning face or red X? Auto trading is off. Hit the AutoTrading button in the toolbar (or Ctrl+E) until it turns green.
Then check the Experts tab at the bottom of MT4. You should see an "initialized" message. Errors show up here too.
Step 8: leave it running
The EA monitors the market and trades on its own. Keep MT4 open and connected. Close the program and the EA stops.
Running it 24/7 without leaving your PC on? You need a VPS. Monthly cost is typically $5–20 and it keeps your EA trading around the clock.
When things go wrong
Frowning face, no trades. AutoTrading is off. Click the toolbar button so it's green. Also check: right-click chart → Expert Advisors → Properties → Common → "Allow live trading" should be checked.
EA doesn't show up in Navigator. Wrong folder. Confirm it's in MQL4\Experts, not a subfolder, not MQL5\Experts. Right-click → Refresh. Still nothing? Restart MT4.
"Trade disabled" error. Your broker account might not allow EAs. Some account types restrict automated trading. Contact your broker.
EA runs but doesn't trade. It's waiting for its conditions to trigger. Check the Experts tab for warnings. Make sure the chart symbol and timeframe match what the EA expects. Some EAs sit idle for hours or days before their first trade. Our error code guide covers all the common error messages.
"DLL imports not allowed." The EA needs DLL access. Right-click chart → Expert Advisors → Properties → Common → check "Allow DLL imports." Only do this for EAs you trust.
What about MT5?
Same idea, different file paths:
.ex5instead of.ex4MQL5\Expertsinstead ofMQL4\Experts- File → Open Data Folder works the same way
Attaching, configuring, and enabling auto trading are nearly identical. Read our MT5 installation guide for the full MT5 walkthrough, or check our MT4 vs MT5 comparison to decide which platform to use.
That's it
Three things to get right: file in the correct folder, EA on the correct chart, auto trading turned on. Most installation problems trace back to one of those three.
After installation, the next steps are backtesting the EA to verify it works on historical data, then demo testing before risking real money. Browse the FXTool marketplace for EAs with live signal pages showing real performance.
About the author: The FXTool team builds and tests MetaTrader trading tools daily. We run every EA we sell on live accounts and publish the results. This guide reflects what we've learned from building 50+ EAs and working with thousands of retail traders.
Forex trading involves significant risk and may result in total loss of capital. This article is for educational purposes only and is not investment advice.