How Do You Install an Expert Advisor on MT4?
Installing an Expert Advisor on MetaTrader 4 takes a few minutes once the EA file has been obtained. The process involves placing the file in the correct platform folder, restarting or refreshing the platform’s Navigator, attaching the EA to a chart, and configuring its settings. None of the steps require programming knowledge, but each must be completed correctly for the EA to function.
This article walks through the installation process step by step, explains the difference between MT4’s two EA file formats, and covers the most common issues that prevent a freshly installed EA from running properly.
Before Installing: File Formats
Expert Advisors for MT4 come in two file formats:
- .mq4 files contain the EA’s source code. They are human-readable and can be edited in the MetaEditor IDE bundled with MT4. They must be compiled before they can run, though MT4 will compile them automatically when placed in the correct folder
- .ex4 files are compiled, ready-to-run versions of EAs. They cannot be edited, but they can be run directly without further compilation
Most commercial EAs are distributed as .ex4 files to protect the developer’s code. Open-source and educational EAs are typically distributed as .mq4 files. Either format can be installed using the same procedure.
Step-by-Step Installation
The following steps apply to installing both .mq4 and .ex4 files on a desktop MT4 platform.
Step 1: Open the data folder.
In MT4, click the File menu, then select Open Data Folder. A Windows Explorer window opens at the platform’s data folder, which is typically a path within AppData. The exact location depends on the operating system and how MT4 was installed.
Step 2: Navigate to the Experts subfolder.
In the data folder, open MQL4, then open Experts. This is the folder where MT4 looks for EA files.
Step 3: Copy the EA file into the Experts folder.
Place the .ex4 or .mq4 file into this folder. If the EA was distributed as a zip archive, extract it first. EA files should sit directly in the Experts folder, not in subfolders, unless the developer specifically instructs otherwise.
Step 4: Refresh the Navigator panel.
Return to MT4. In the Navigator panel on the left (open with Ctrl+N if not visible), right-click on Expert Advisors and select Refresh. The newly added EA should appear in the list. If it does not, close and reopen MT4 to ensure the platform reads the updated Experts folder.
Step 5: Enable AutoTrading.
In the main toolbar at the top of MT4, locate the AutoTrading button (it looks like a play button or a green smiley). Click it once. The button should change colour to indicate that AutoTrading is enabled. Without this, no EA will trade, regardless of its individual settings.
Step 6: Attach the EA to a chart.
Drag the EA from the Navigator panel onto the chart of the symbol on which it should run. Alternatively, double-click the EA name in the Navigator. A configuration dialog appears.
Step 7: Configure the EA settings.
The dialog has several tabs:
- Common tab includes options such as Long & Short positions (typically enabled by default), Allow live trading, Allow DLL imports (if the EA uses external libraries), and Allow modification of Signal settings
- Inputs tab lists the EA’s configurable parameters. These vary by EA but commonly include lot size, stop loss in pips, take profit in pips, and various strategy-specific settings
Verify that Allow live trading is checked. Without it, the EA cannot place orders.
Step 8: Click OK to attach the EA.
The dialog closes, and the EA’s name appears in the top right corner of the chart. Next to the name, a small smiley face icon indicates whether the EA is active.
- A smiling face means the EA is running with AutoTrading enabled
- A frowning or sad face means the EA is attached but AutoTrading is disabled (either globally via the toolbar or for that specific EA)
- A red square may indicate an error
Verifying the EA Is Running
A few visual checks confirm the EA is operational:
- The EA name and smiley face are visible in the top right of the chart
- The AutoTrading button in the toolbar is green or enabled
- The Experts tab at the bottom of the platform shows log entries from the EA, such as initialisation messages or trade attempts
- If the EA opens trades when its conditions are met, those trades appear in the Trade tab
If the EA has been installed correctly but does not trade, check the Experts and Journal tabs at the bottom of the platform. These log any errors, including failed initialisation, missing files, or rejected orders.
Common Installation Issues
The EA does not appear in the Navigator panel.
This usually means the file was placed in the wrong folder, or the platform has not refreshed. Verify the file is in the MQL4/Experts folder (not MQL4/Scripts or MQL4/Indicators), then refresh the Navigator or restart MT4.
The AutoTrading button is greyed out.
Some installations have AutoTrading disabled at the platform configuration level. Open Tools → Options → Expert Advisors and ensure “Allow algorithmic trading” is checked.
The smiley face is sad or red after attaching the EA.
Either AutoTrading is disabled (check the toolbar), or “Allow live trading” was not enabled in the EA’s configuration dialog. Right-click on the chart, select Expert Advisors → Properties, and re-check the Common tab.
The EA initialises but does not place trades.
The EA may be working correctly but waiting for its conditions to be met. Check the Experts tab for log messages. If the EA reports an error such as “Trade is disabled,” the broker may have restricted certain order types on the account. If it reports “Not enough money” or similar, the lot size in the inputs may be too large for the account equity.
Trades are rejected with an error.
The Journal tab logs broker-side rejections. Common reasons include incorrect lot sizes, stop loss too close to the current price (violating the broker’s minimum stop level), and unsupported order types. The exact error message usually identifies the issue.
Practical Considerations After Installation
Once the EA is installed and running, a few additional practices help ensure reliable operation:
- The MT4 platform must remain open and connected to the broker for the EA to function. For 24/5 operation, a forex VPS is the standard solution
- An EA only operates on the chart it is attached to. Attaching the same EA to multiple charts requires consideration of how it manages position sizes and whether it might conflict with itself
- Updates to the EA file require replacing the file in the Experts folder and refreshing the platform. Open positions are usually not affected by updates, but the next EA execution will use the new code
- Backtesting an installed EA is done via the Strategy Tester, accessed through the View menu or Ctrl+R
Frequently Asked Questions
Where do EA files go in MT4? EA files belong in the MQL4/Experts folder within the MT4 data folder. The data folder is accessed via File → Open Data Folder in MT4. Both .ex4 and .mq4 files go in the same Experts folder.
Do I need to compile an EA after installing it? .ex4 files are already compiled and ready to run. .mq4 files contain source code and need compilation, but MT4 typically compiles them automatically when placed in the Experts folder. If a compilation error occurs, the EA will not appear in the Navigator or will appear with a different icon.
Can I install an EA without restarting MT4? Yes. After copying the file into the Experts folder, right-click Expert Advisors in the Navigator and select Refresh. The EA should appear without a platform restart. A restart is only needed if the refresh does not pick up the file.
Why does my EA have a sad face on the chart? A sad face indicates the EA is attached but AutoTrading is disabled. Check the AutoTrading button in the toolbar (it should be green), and verify Allow live trading is checked in the EA’s Common tab properties.
How many EAs can I install at once? There is no hard limit on the number of EAs installed in the Experts folder. The practical limit is on how many run simultaneously. Each EA must be attached to its own chart, and the computer or VPS must have sufficient resources to handle all of them.
Can I install an EA on a demo account first? Yes. EAs can be installed on demo accounts using the same procedure. Running an EA on a demo account before deploying it on a live account is generally recommended to verify behaviour without financial risk.
What happens if I close the chart with the EA attached? The EA stops running. To resume, drag the EA back onto a chart. If positions opened by the EA remain in the account, they continue to exist and are managed by the broker, but the EA no longer monitors or modifies them until reattached.