What Is an Expert Advisor?
An Expert Advisor (EA) is an automated trading program that runs inside MetaTrader 4 or MetaTrader 5. Written in MQL4 or MQL5 respectively, EAs can monitor the market, generate trade signals, and execute orders automatically — without you needing to be in front of your screen.
EAs range from simple automated entry/exit systems to complex algorithmic strategies that manage multiple positions, adjust to volatility, and apply sophisticated risk controls.
Step 1: Obtain the EA File
Expert Advisors come as compiled files with the following extensions:
- .ex4 — compiled EA for MetaTrader 4
- .ex5 — compiled EA for MetaTrader 5
- .mq4 / .mq5 — source code files (need to be compiled before use)
EAs are available from the MetaQuotes Market (accessible inside MT4/MT5), third-party developers, or you can write your own. Always source EAs from reputable providers and test thoroughly on a demo account first.
Step 2: Install the EA File into MetaTrader
Method A: Drag and Drop via File Manager
- Open MetaTrader 4 or MT5
- Click File → Open Data Folder in the top menu
- Navigate to MQL4 → Experts (MT4) or MQL5 → Experts (MT5)
- Copy or drag your .ex4 or .ex5 file into this folder
- Return to MetaTrader and press F5 (or right-click the Navigator panel and select Refresh)
Method B: Direct Install from MT4/MT5
- In MetaTrader, go to File → Open Data Folder
- Place the file as above, then restart MetaTrader if it doesn't appear automatically
Step 3: Attach the EA to a Chart
- Open the Navigator panel (Ctrl+N or View → Navigator)
- Expand the Expert Advisors section — your EA should now appear in the list
- Double-click the EA, or drag it onto a chart of your chosen currency pair and timeframe
- A settings dialog will appear — configure the inputs (lot size, stop-loss, take-profit, etc.)
- Click OK to attach
A smiley face icon (😊) in the top-right corner of the chart confirms the EA is active. A frowning face means auto-trading is disabled.
Step 4: Enable Automated Trading
For the EA to actually place trades, you must enable automated trading in MetaTrader:
- Click the AutoTrading button in the main toolbar (it should turn green)
- Also check Tools → Options → Expert Advisors and ensure "Allow automated trading" is checked
- If your EA needs to make web requests (e.g., for news data), allow the relevant URLs in the same settings panel
Step 5: Test Your EA Before Going Live
Never run an untested EA on a live account. Use the built-in Strategy Tester:
- Go to View → Strategy Tester (or press Ctrl+R)
- Select your EA from the dropdown
- Choose the symbol, timeframe, date range, and initial deposit
- Select "Every tick" for the most accurate simulation
- Click Start and review the results in the Report and Graph tabs
Look for consistent results, a healthy profit factor, and a manageable drawdown. Be cautious of EAs that show suspiciously perfect backtests — this often indicates curve-fitting to historical data.
Common Issues and Solutions
- EA not appearing in Navigator: Refresh the Navigator or restart MT4/MT5
- EA attached but not trading: Check AutoTrading is enabled and the account has sufficient margin
- DLL errors: Enable "Allow DLL imports" in Tools → Options → Expert Advisors
- EA trades on demo but not live: Some EAs have live-account restrictions — check the documentation
Final Advice
Expert Advisors are powerful tools, but they require ongoing monitoring. Market conditions change, and an EA optimized for one environment may underperform in another. Always run EAs with appropriate position sizing, keep them updated, and review their performance regularly against your expectations.