Install EA on MT4: Step-by-Step Guide (2026)
To install an EA on MT4: 1) Open MT4 and go to File → Open Data Folder, 2) Navigate to MQL4 → Experts, 3) Copy your .ex4 file into this folder, 4) Restart MT4 or refresh the Navigator, 5) Drag the EA onto your chart and enable AutoTrading. The entire process takes under 5 minutes.
I've installed hundreds of Expert Advisors on MT4 for traders around the world, and once you know the exact steps, the process really is straightforward. Most guides skip the details that actually trip people up: where the data folder lives, how to handle DLL files, what to do when the EA just refuses to show up. This guide on how to install an EA on MT4 covers the whole process, from file placement to configuration, plus every issue I've watched traders run into along the way.
In This Guide
- Before You Start
- MT4 vs MT5 Installation Differences
- Step 1: Locate the MT4 Data Folder
- Step 2: Copy EA Files
- EA Security Checklist
- Step 3: Refresh MT4
- Step 4: Attach EA to Chart
- Step 5: Configure EA Settings
- Step 6: Enable AutoTrading
- Keeping Your EA Running 24/5
- Troubleshooting Common Issues
- Running Multiple EAs
- FAQ
Before You Start
Before installing any EA on MT4, make sure you have these prerequisites in place:
- MT4 installed and running: download it from your broker, or grab it directly from MetaQuotes if you haven't already
- EA files ready, meaning either an .ex4 file (compiled) or an .mq4 file (source code)
- A trading account logged in, demo or live, it just needs to be active
- The correct instrument available: check that your broker actually offers the symbol the EA trades (e.g., XAUUSD for gold)
- An account type that allows automated trading: most brokers permit EAs by default, but a small number of Islamic (swap-free) or heavily restricted account types disable it. Check your account settings or ask support if you are unsure
It is also worth confirming your broker is properly regulated before wiring any funds into a live account. Regulators such as the CFTC in the US publish guidance on verifying a broker's registration and spotting common forex fraud patterns, and it is a five-minute check worth doing once, before you install anything.
Understanding EA File Types
You may receive several types of files when you purchase or download an EA. Here is what each file type does:
| File Type | Extension | Where to Place | Purpose |
|---|---|---|---|
| Compiled EA | .ex4 | MQL4/Experts | Ready-to-run EA file |
| Source Code | .mq4 | MQL4/Experts | Editable code, needs compiling |
| Library | .dll | MQL4/Libraries | External functions the EA uses |
| Include File | .mqh | MQL4/Include | Shared code modules |
| Preset | .set | MQL4/Presets | Saved EA settings |
The distinction between .ex4 and .mq4 trips up more people than any other part of this process. An .ex4 file is compiled, meaning the code has already been turned into something MT4 can execute directly, and it is what most EA vendors hand you. An .mq4 file is the human-readable source code, which MT4 cannot run until it has been compiled through MetaEditor, the code editor bundled with every MT4 installation. If you only received an .mq4 file, don't worry, compiling it is a one-click step covered later in this guide. For the full language reference behind what these files actually contain, MetaQuotes maintains the official MQL documentation.
MT4 vs MT5: Installation Differences You Should Know
This guide covers MT4 specifically, but a lot of traders end up running both platforms, either because their broker only offers one, or because they want to compare execution. The installation logic is the same on both platforms, but the folder names, file extensions, and a couple of settings are different enough to cause confusion if you copy files into the wrong place. If you are setting up on both, see our companion guide to installing an EA on MT5 for the platform-specific walkthrough, and our broader MT4 vs MT5 comparison if you are still deciding which platform to trade on.
| Detail | MT4 | MT5 |
|---|---|---|
| Data folder subfolder | MQL4 | MQL5 |
| Compiled EA extension | .ex4 | .ex5 |
| Source code extension | .mq4 | .mq5 |
| Compiler | MetaEditor (F7) | MetaEditor (F7, MT5 build) |
| Hedging support | Hedging only | Hedging or netting, per account |
| Strategy Tester | Single-thread, slower | Multi-core, faster backtests |
| Programming language | MQL4 | MQL5 (object-oriented, more built-in functions) |
Because the two languages are not interchangeable, an .ex4 file will never appear in an MT5 Navigator, and an .ex5 file will never appear in MT4 no matter how many times you refresh. If your EA seller provides both versions, as Golden Viper does, covering both MT4 and MT5, make sure you are copying the matching file into the matching platform's folder.
Step 1: Locate the MT4 Data Folder
The data folder is where MT4 stores all user files including EAs, indicators, and templates. Finding this folder is the first and most important step.
- Open your MT4 platform
- Click File in the top menu bar
- Select Open Data Folder
- A Windows Explorer window opens showing your MT4 data directory
- Navigate to the MQL4 folder
- Open the Experts subfolder
Important: Do not confuse the data folder with the MT4 installation folder (usually in Program Files). The data folder is in your user profile directory (AppData) and is where MT4 actually reads EA files from. Always use File → Open Data Folder to find the correct path.
Alternative Method: Direct Path
If you have multiple MT4 installations, the data folder path typically follows this pattern:
- Windows:
C:\Users\[YourName]\AppData\Roaming\MetaQuotes\Terminal\[HASH]\MQL4\Experts - Each broker installation gets a unique hash folder, so make sure you are in the right one
Installing on Mac
MT4 does not have a native macOS build, so Mac traders run it through Wine or a virtualization layer such as Parallels, or through the wrapped version some brokers distribute. The data folder still exists inside that Windows environment and is reached the same way, through File → Open Data Folder inside the running MT4 window. If your Mac setup uses a broker's own MT4-for-Mac wrapper, right-click the app icon and look for a "Show Package Contents" or equivalent option if File → Open Data Folder is not available, since some wrappers relocate the shortcut.
Step 2: Copy EA Files to the Correct Folders
With the data folder open, place each file in its designated location:
- Copy .ex4 or .mq4 files into the MQL4/Experts folder
- If the EA includes .dll files, copy them to MQL4/Libraries
- If there are .mqh include files, place them in MQL4/Include
- Any .set preset files go into MQL4/Presets
Do not place files in subfolders unless the EA documentation specifically instructs you to. MT4 does scan subfolders within Experts, but some EAs expect to be in the root Experts directory. When in doubt, place files directly in MQL4/Experts.
Most sellers deliver EAs as a .zip archive rather than a loose file, so you will need to extract it first, either with Windows' built-in "Extract All" or a tool like 7-Zip. Extract to a temporary folder before copying, and check that the file sizes look reasonable for what you expect; a 4KB .ex4 file where you were promised a full trading system, or a file that arrived without any accompanying documentation, is worth double-checking with the vendor before you place it anywhere near a live account.
EA Installation Security: What to Verify Before You Run Any File
An Expert Advisor is executable code running inside your trading terminal with the ability to open, modify, and close positions on your behalf. That makes basic file hygiene worth a paragraph before you attach anything to a live chart.
- Only download EAs from the vendor's own site or a marketplace you trust, such as the official MQL5 Market, which reviews submissions before listing them. Pirated or "cracked" copies of paid EAs circulated on forums are a common way traders end up with tampered code.
- Treat "Allow DLL imports" as a real security decision, not a checkbox to tick automatically. A DLL executes outside MT4's normal sandbox with full access to your system, so only enable it for EAs from a source you trust, and only when the documentation explains why the DLL is needed.
- Be skeptical of EAs sold with guaranteed returns or "cannot lose" language. No legitimate trading system can promise that, and the FTC's consumer advice resources are a good general reference on how these pitches are typically structured.
- Keep Windows Defender or your antivirus updated rather than disabling it to "make the EA work." If real-time protection keeps quarantining a specific file, that is useful information, not just an inconvenience to bypass.
- Verify performance claims through an independent, publicly auditable source rather than screenshots. Services like Myfxbook connect directly to a live trading account and display results the vendor cannot edit after the fact, which is a meaningfully different level of proof than a marketing page.
Step 3: Refresh MT4 to Detect the EA
After copying files, MT4 needs to recognize the new EA. You have two options:
- Quick method: In the Navigator panel (Ctrl+N), right-click on Expert Advisors and select Refresh
- Full method: Close and restart MT4 completely, which guarantees detection
After refreshing, your EA should appear in the Navigator panel under "Expert Advisors." If it does not appear, check the troubleshooting section below.
MT4 scans the Experts folder when it starts, and the Navigator panel is really just a cached view of what it found at that point. Copying a file into the folder afterward doesn't update that cache on its own, which is why a refresh or restart is required; it's not a bug, just how the terminal was designed to avoid re-scanning the disk on every click.
Step 4: Attach the EA to a Chart
Now that the EA is visible in the Navigator, attach it to the correct chart:
- Open a chart for the instrument the EA trades (e.g., XAUUSD)
- Set the chart to the correct timeframe (check EA documentation for recommended timeframe)
- In the Navigator panel, find your EA under "Expert Advisors"
- Double-click the EA name, or drag it onto the chart
- The EA properties dialog will appear automatically
Common Tab Settings
In the Common tab of the EA properties dialog, configure these critical settings:
- Allow live trading: Must be checked for the EA to execute trades
- Allow DLL imports: Check this only if the EA requires DLL files (the documentation will specify)
- Allow import of external experts: Enable if the EA calls other EAs or scripts
Leave "Allow DLL imports" unchecked unless the EA's own documentation tells you it's required, and only check it once you've confirmed the file came from the vendor's official source (see the security checklist above). Most modern EAs run entirely on native MQL logic and don't need DLL access at all, so treat a vague or missing explanation for why one does as a reason to ask the vendor directly before enabling it.
Step 5: Configure EA Settings (Inputs Tab)
The Inputs tab contains the EA's configurable parameters. Every EA is different, but common settings include:
- Lot size or risk percentage: start conservative here. See our lot size guide for $1,000 accounts
- Magic number, a unique identifier for the EA's trades that matters most once you're running more than one EA
- Stop loss and take profit, where the defaults are usually a sensible starting point
- Trading hours, since some EAs let you restrict trading to specific sessions
- License key: enter it here if the EA requires activation
Save your settings: After configuring the Inputs tab, click the Save button to create a .set file. This lets you quickly reload your exact configuration if you ever need to re-attach the EA or restore settings after an MT4 update.
Lot Size vs Risk Percentage
Some EAs ask for a fixed lot size (a flat 0.01, 0.10, and so on for every trade), while others ask for a risk percentage and calculate the lot size automatically based on your current balance and stop-loss distance. Percentage-based risk generally scales more sensibly as your account grows or shrinks, but either setting works fine as long as you understand which one you're configuring; mixing them up, entering "1" meaning 1% into a field expecting a fixed lot size, for example, is a fast way to massively over-leverage an account. For background on how position sizing interacts with leverage, Investopedia's overview of leverage in trading is a useful primer if the concept is new to you.
Trading hours settings matter more for gold than for most forex pairs, since XAUUSD volatility is concentrated around specific sessions. If the EA lets you restrict active hours, check its documentation for the recommended window before changing the defaults, rather than guessing. Gold trades nearly around the clock through the underlying futures market tracked by exchanges like CME Group, but liquidity and spreads at your broker still vary noticeably by session.
Step 6: Enable AutoTrading
The final step is enabling automated trading globally in MT4:
- Click the AutoTrading button in the toolbar; it needs to show green
- Verify in Tools → Options → Expert Advisors that "Allow automated trading" is checked
- Check the chart corner: you should see a smiley face icon, which confirms the EA is active
If you see a frowning face instead of a smiley, the EA does not have permission to trade. Revisit Step 4 and ensure "Allow live trading" is checked in the EA properties.
Verification Checklist
Confirm everything is working correctly by checking all of these:
- AutoTrading button is green in the toolbar
- Smiley face visible in the chart corner
- No error messages in the Experts tab (Ctrl+T, then click Experts)
- EA name is displayed on the chart
- Correct symbol and timeframe selected
Keeping Your EA Running 24/5
Installing the EA correctly is only half the job. An EA can only trade while the MT4 terminal it's attached to is open, logged in, and connected to your broker, which raises the question of what happens when you close your laptop or your PC goes to sleep.
Does an EA Work on MT4 Mobile?
No. The MT4 mobile app is built for monitoring and manual trade management, not for running Expert Advisor code. You can watch an EA's open trades from your phone, and even close them manually if needed, but you cannot install or execute an EA on the mobile app itself. The EA has to keep running on whichever desktop terminal it's attached to.
Should You Use a VPS?
A Virtual Private Server keeps a lightweight Windows environment running in a data center around the clock, so your EA stays connected even when your own computer is off, asleep, or losing its internet connection. It isn't mandatory, plenty of traders run EAs on a dedicated home PC that never sleeps, but a VPS removes an entire category of failure: home internet drops, forced Windows updates that reboot mid-session, and the laptop lid getting closed by accident. We cover the setup process in detail in running an MT4 robot on a VPS, and if you're comparing providers, see our breakdown of the best VPS options for forex EAs.
Troubleshooting Common Issues
Even experienced traders run into these problems. Here are the fixes I use most often:
EA Does Not Appear in Navigator
- Verify the file is .ex4 or .mq4 (if it's a .zip, extract it first)
- Confirm the file is in MQL4/Experts, not MQL4/Indicators or another folder
- Right-click Expert Advisors in Navigator and select Refresh
- If using .mq4 source code, open it in MetaEditor and compile (F7)
- Restart MT4 completely if refresh does not work
EA Shows Frowning Face
- AutoTrading is disabled, so click the button to turn it green
- "Allow live trading" is unchecked in EA properties
- DLL imports are blocked but required by the EA
- License validation failed; check the Experts tab for error details
EA Loads but Does Not Trade
If the smiley face is showing but the EA is not placing trades, the issue is usually not with installation but with trading conditions. See our detailed guide on fixing an EA that is not trading for a complete diagnostic checklist.
DLL Error Messages
- Ensure .dll files are in MQL4/Libraries (not Experts)
- "Allow DLL imports" must be checked in EA properties
- Some antivirus software blocks DLLs, so add an exception for the MT4 data folder
- 64-bit DLLs won't work with 32-bit MT4; contact the EA provider for the correct version
Broker Rejects Trades or Shows Error Codes
Once the EA is installed correctly and the smiley face is showing, a separate class of problem can still stop trades from opening: the broker itself rejecting the order. This isn't an installation issue, but it's easy to mistake for one, so it's worth a quick reference table of what the most common codes actually mean.
| Error Message | Likely Cause | Fix |
|---|---|---|
| Invalid Stops (130) | SL/TP set too close to price for your broker's minimum stop distance | Widen the stop distance or check the symbol's freeze/stop level in Market Watch properties |
| Not Enough Money (134) | Lot size too large for available free margin | Reduce lot size or risk percentage, or deposit more margin |
| Trade Context Busy (146) | Another trade operation is still processing | Usually resolves itself; persistent cases point to too many EAs firing simultaneously |
| Off Quotes (136) | Price moved before the order reached the server | Check your broker's execution speed and slippage settings; common during high-volatility gold news events |
| Market Closed | Trading outside the symbol's session hours | Confirm the broker's XAUUSD trading hours, which can differ from standard forex sessions |
MT4 Freezes or Runs Slowly After Adding an EA
If the terminal becomes sluggish right after you attach a new EA, check the Experts tab (Ctrl+T) for a flood of repeating log messages, which usually means the EA is running a loop more often than intended. Also confirm you aren't running the EA on a tick chart or an unusually low timeframe if the documentation doesn't call for it, since some strategies are tuned for M15 or H1 and become resource-heavy on M1.
Running Multiple EAs on MT4
MT4 allows only one EA per chart. To run multiple EAs simultaneously:
- Open a separate chart for each EA (even if they trade the same symbol)
- Assign a unique magic number to each EA so their trades do not interfere
- Monitor total margin usage across all EAs to avoid margin calls
- Consider using a broker with sufficient leverage for multi-EA setups
Performance note: Running too many EAs on a single MT4 instance can slow execution. If you run more than 5 EAs, consider using a VPS to ensure stable performance. Each EA consumes CPU resources, especially during tick-intensive periods.
Margin usage is the part traders most often overlook when stacking multiple EAs. Each open position ties up margin regardless of which EA opened it, so your account's total exposure is the sum of everything running, not just whatever a single EA's own risk settings suggest. Investopedia's explainer on margin accounts is a useful refresher if you're combining several automated strategies for the first time. For a full VPS walkthrough covering setup from scratch, see how to install and run an EA on a Windows VPS.
Frequently Asked Questions About Installing EA on MT4
Where do I put EA files in MT4?
Place .ex4 or .mq4 files in the MQL4/Experts folder inside your MT4 data directory. Access it via File, Open Data Folder in MT4, then navigate to MQL4, then Experts. If the EA includes DLL or library files, place those in the MQL4/Libraries folder.
Why is my EA not showing in MT4 Navigator?
After copying files, you must refresh MT4. Right-click Expert Advisors in the Navigator panel and select Refresh, or restart MT4 completely. Also verify the file is an .ex4 or .mq4 file placed in MQL4/Experts, not a subfolder or wrong directory.
Can I install multiple EAs on MT4?
Yes, you can install as many EAs as you want, but MT4 only allows one EA per chart. To run multiple EAs simultaneously, open separate charts for each EA. Use unique magic numbers to prevent trade conflicts between EAs.
Do I need to compile .mq4 files before using them?
Yes. MQ4 files are source code and must be compiled into .ex4 files using MetaEditor (press F7 to compile). Most EA sellers provide pre-compiled .ex4 files so you can skip this step.
Will my EA settings be lost if I update MT4?
EA files in MQL4/Experts are preserved during updates. However, chart-attached settings may reset. Save your settings as a .set preset file using the Save button in the EA Inputs tab before updating.
Do EAs work on the MT4 mobile app?
No. The MT4 mobile app can only monitor and manage trades that an EA opened elsewhere; it cannot install, load, or run Expert Advisor code itself. Your EA needs to keep running on the desktop terminal it is attached to, either on your own computer or on a VPS, for it to keep trading.
Do I need a VPS to run an EA on MT4?
A VPS is not strictly required, but it is strongly recommended for any EA meant to trade unattended. Your home PC has to stay powered on, connected, and free of sleep or update interruptions for the EA to keep working, which a VPS handles automatically with far higher uptime.
Is it safe to enable "Allow DLL imports" for an EA?
Only enable DLL imports for EAs from a source you trust, since a DLL runs with full access to your system rather than inside MT4's sandboxed environment. Reputable EA vendors document exactly why a DLL is required; if that explanation is missing, treat the request as a red flag and ask before enabling it.
What is the difference between installing an EA on MT4 versus MT5?
The process is conceptually identical, but MT5 uses an MQL5/Experts folder instead of MQL4/Experts, compiled files use the .ex5 extension instead of .ex4, and MT5 requires the MetaEditor bundled with MT5 to compile .mq5 source. An EA built for MT4 will not run on MT5 without being recompiled for that platform.
Let Golden Viper EA trade gold for you
Automated XAUUSD trading for MT4 & MT5, verified live on Myfxbook. One-time $199, lifetime access.
Get Lifetime Access — $199