MT4 / MT5 · Guide 09
Expert Advisors (EAs): Installation & Backtesting
Expert Advisors are trading robots that automate strategy execution in MetaTrader. Learn how to install, configure and test them.
What is an Expert Advisor?
An Expert Advisor (EA) is a program written in MQL4 (MT4) or MQL5 (MT5) that can analyse the market and execute trades automatically based on predefined rules. It can trade 24/5 without human intervention.
Caution with EAs: Most commercial EAs do not perform consistently in live markets. Many show good backtesting results (historical data) but fail under live market conditions. Never use an EA with real money without testing it thoroughly first.
Installing an Expert Advisor
- Obtain the EA file (.ex4 for MT4, .ex5 for MT5)
- In MetaTrader: File → Open Data Folder
- Navigate to MQL4/Experts (or MQL5/Experts in MT5)
- Copy the .ex4 or .ex5 file into that folder
- Restart MetaTrader or refresh the Navigator
- The EA will appear in the Navigator under "Expert Advisors"
Activating an Expert Advisor
- Open the chart for the pair and timeframe the EA will trade
- Drag the EA from the Navigator onto the chart
- In the configuration window: adjust the EA parameters and enable "Allow Automated Trading"
- Click "OK"
- Make sure the "AutoTrading" button in the toolbar is enabled (green)
Important: For an EA to trade, MetaTrader must be open and connected to the broker. If you close MT4/MT5, the EA stops working. Some traders use a VPS (Virtual Private Server) to keep MT4/MT5 running 24/5.
Backtesting in the Strategy Tester
The Strategy Tester lets you test an EA against historical data to evaluate its performance before using it with real money:
- Open the Strategy Tester: View → Strategy Tester or Ctrl+R
- In the lower panel, select the EA you want to test
- Choose the symbol (currency pair) and period (timeframe)
- Select the date range and simulation model ("Every tick" is the most precise)
- Set the initial capital and other parameters
- Click "Start" and wait for the simulation to complete
- Analyse the results: maximum drawdown, Sharpe ratio, % winning trades, equity curve
Key Backtesting Metrics
- Profit factor > 1.5: Ratio of total gains to total losses. Minimum acceptable level.
- Maximum drawdown < 20%: The largest peak-to-trough drop. The lower, the better.
- Number of trades > 200: With few trades, backtesting results are not statistically valid.
- Ascending equity curve: Consistent growth without abrupt profit spikes.
Educational content only. This does not constitute financial or investment advice. Trading involves risk of loss; past results do not guarantee future results.