Table of Contents
- What is an Expert Advisor in MetaTrader 5?
- Before You Install — Prerequisites Checklist
- Step-by-Step Installation Guide
- How to Configure Your EA for Optimal Performance
- Troubleshooting — 10 Most Common EA Problems and Fixes
- How to Backtest Your EA in MT5 Strategy Tester
- Advanced Optimization Techniques
- Pro Tips from 29 Years Experience
- Frequently Asked Questions
- Conclusion
What is an Expert Advisor in MetaTrader 5?
When I first started trading in 1997, the concept of automated trading was science fiction. Today, Expert Advisors (EAs) are the backbone of modern forex trading. An EA in MetaTrader 5 is essentially a program written in MQL5 programming language that can analyze market data and execute trades based on predefined rules.
MetaTrader 5 is the successor to the legendary MT4 platform, and it brings significant improvements for EA users. The MQL5 language is faster, supports multi-threaded strategy testing, includes a built-in economic calendar, and allows hedge and netting account types. If you are still on MT4, it is time to upgrade — and this guide will show you exactly how to set up your EAs on the new platform.
There are two types of EA files you will encounter:
- .mq5 files — Source code files that can be viewed and edited in MetaEditor (the built-in code editor)
- .ex5 files — Compiled files that are ready to run but cannot be edited. Most commercial and free EAs are distributed in this format to protect the developer's code.
Our EA Semi-Auto is distributed as an .ex5 file for security and performance reasons. It has been compiled and optimized for the fastest possible execution on XM's servers.
Before You Install — Prerequisites Checklist
Before we dive into the installation process, make sure you have everything ready. I have helped over 5,000 traders install EAs, and 90% of problems come from skipping this checklist:
Hardware Requirements
- Operating System: Windows 10 or 11 (64-bit recommended). Mac users can use Parallels, Boot Camp, or Wine. Linux users can use Wine or a VPS.
- RAM: Minimum 4GB, recommended 8GB+ (especially if running multiple charts)
- Internet: Stable broadband connection. Minimum 10 Mbps download, but more important is low latency (ping under 100ms to your broker's server)
- Storage: At least 2GB free space for MT5 + historical data
Software Requirements
- MetaTrader 5 — Latest version, downloaded from XM's website (not a generic version)
- XM Trading Account — Either demo or live. Our EA works with Standard, Ultra Low, and Zero account types
- EA File — The .ex5 file downloaded from our secure page at SiamCafe.net/download
Account Setup
If you do not have an XM account yet, here is how to set one up in under 5 minutes:
- Click our partner link to open XM's registration page
- Fill in your personal details (name, email, phone)
- Choose your account type:
- Standard Account — Best for beginners, minimum $5, spreads from 1.0 pip
- Ultra Low Account — Lower spreads from 0.6 pip, minimum $5
- Zero Account — Raw spreads from 0.0 pip + commission, minimum $5, best for EA trading
- Verify your identity (passport or national ID + proof of address)
- Fund your account or switch to demo for testing
Step-by-Step Installation Guide
Step 1: Download and Install MetaTrader 5
Go to XM's website and download MT5 for your operating system. Run the installer, accept the terms, and let it complete. The first launch will download historical data, which may take a few minutes.
Step 2: Log In to Your Account
When MT5 opens for the first time, it will show a login dialog. Enter:
- Server: Select your XM server (shown in your account email)
- Login: Your MT5 account number
- Password: Your trading password (not the investor password)
If login is successful, you will see your account balance in the bottom-left corner and the "Connection" bar will show green.
Step 3: Locate the Data Folder
This is the most critical step, and where most people go wrong.
- In MT5, go to File → Open Data Folder
- A Windows Explorer window will open showing something like:
C:\Users\YourName\AppData\Roaming\MetaQuotes\Terminal\ABCD1234\ - Navigate into MQL5 → Experts
- This is your EA folder. Bookmark it or note the path.
Step 4: Copy the EA File
- Download the EA Semi-Auto .ex5 file from SiamCafe.net/download
- Copy (or drag) the .ex5 file into the
MQL5/Expertsfolder - If the EA comes with additional files (.set files for presets, .dll files for libraries), copy those to their respective folders:
- .set files →
MQL5/Presets - .dll files →
MQL5/Libraries
- .set files →
Step 5: Restart and Attach
- Close and reopen MT5 (this is mandatory — MT5 only scans for new EAs at startup)
- In the Navigator panel (View → Navigator if hidden), expand Expert Advisors
- You should see "EA_Semi_Auto" (or similar name) in the list
- Open a chart for the pair you want to trade (e.g., EURUSD, H1 timeframe)
- Double-click the EA name in Navigator, or drag it onto the chart
- A properties dialog will appear — configure settings (see next section)
- Click OK
Step 6: Enable Algorithmic Trading
- Go to Tools → Options → Expert Advisors tab
- Enable: "Allow algorithmic trading"
- Enable: "Allow DLL imports" (needed for news filter and other features)
- Click OK
- On the main toolbar, click the Algo Trading button (it should turn green)
- Check the top-right corner of your chart — you should see a smiley face icon, indicating the EA is active
How to Configure Your EA for Optimal Performance
Once the EA is attached to your chart, the configuration window lets you fine-tune its behavior. Here is what each major setting does and what I recommend:
General Tab
- Allow Algo Trading — Must be checked
- Allow modification of Signals settings — Check this to enable our signal system
Inputs Tab — Key Parameters
| Parameter | Default | My Recommendation |
|---|---|---|
| RiskPercent | 1.0 | 0.5 for beginners, 1.0 for experienced |
| MaxSpread | 3.0 | 2.0 for majors, 5.0 for gold |
| TakeProfit_Pips | 50 | Leave default — EA uses dynamic TP |
| StopLoss_Pips | 30 | Leave default — EA uses structure-based SL |
| UseNewsFilter | true | Always keep ON |
| TradingSessions | London_NY | London_NY for beginners, All for advanced |
| MaxOpenTrades | 3 | 2 for beginners, 3-5 for experienced |
| MagicNumber | 12345 | Change if running multiple instances |
Troubleshooting — 10 Most Common EA Problems and Fixes
After years of supporting thousands of EA users, these are the problems I see most often:
- "EA not found in Navigator" — Wrong folder. Make sure the .ex5 file is in MQL5/Experts, not MQL5/Indicators or MQL5/Scripts. Restart MT5.
- "Smiley face is gray/sad" — Auto trading is disabled. Click the Algo Trading button on the toolbar. Also check Tools → Options → Expert Advisors → Allow algorithmic trading.
- "Trade not allowed" error — Your account type may not support algorithmic trading, or Expert Advisors are disabled on your specific server. Contact XM support.
- "Not enough money" error — Your margin is insufficient for the position size the EA is trying to open. Either deposit more funds or reduce the RiskPercent setting.
- "Invalid stops" error — Your stop loss or take profit is too close to the current price. This usually happens with brokers that have minimum stop levels. XM has very low stop levels, so this is rare.
- EA runs but no trades — The EA might be waiting for a valid setup. Not every hour produces a trade signal. Check the Experts tab (bottom of MT5) for log messages. The EA will show "Scanning..." when active.
- EA places too many trades — Check MaxOpenTrades setting. Also verify the MagicNumber is unique if you run the EA on multiple charts.
- "DLL imports not allowed" — Go to Tools → Options → Expert Advisors and enable "Allow DLL imports."
- Slow execution — This is usually a network issue, not an EA issue. Check your ping to XM's server (Tools → Options → Server). If ping is over 200ms, consider a VPS closer to XM's data center.
- EA works on demo but not live — Some EAs have license restrictions. Our EA Semi-Auto works on both demo and live accounts without restrictions.
How to Backtest Your EA in MT5 Strategy Tester
Before risking real money, you should always backtest. MT5's Strategy Tester is significantly better than MT4's. Here is how to use it properly:
- Open View → Strategy Tester (or press Ctrl+R)
- Select your EA from the dropdown
- Choose the symbol (e.g., EURUSD) and timeframe (e.g., H1)
- Set the date range — I recommend at least 1 year of data, ideally 2-3 years
- Set modeling to "Every tick based on real ticks" — This is the most accurate mode, exclusive to MT5
- Set initial deposit to match your planned live account size
- Click Start
After the backtest completes, examine these key metrics:
| Metric | Good Range | What It Means |
|---|---|---|
| Profit Factor | Above 1.5 | Total profit ÷ total loss. Higher = better |
| Max Drawdown % | Under 20% | Largest peak-to-valley decline. Lower = safer |
| Win Rate | 45-65% | Percentage of profitable trades. Not the most important metric |
| Recovery Factor | Above 3 | Net profit ÷ max drawdown. Higher = more resilient |
| Sharpe Ratio | Above 1.0 | Risk-adjusted return. Above 2.0 is excellent |
Advanced Optimization Techniques
Walk-Forward Optimization
The biggest mistake traders make is optimizing EA parameters on historical data and assuming they will work going forward. Walk-forward optimization solves this:
- Divide your data into segments (e.g., 6 months optimization + 3 months testing)
- Optimize on the first segment, test on the second
- Slide the window forward and repeat
- Only use parameter sets that perform well across ALL test segments
Multi-Symbol Testing
MT5 supports multi-currency backtesting, meaning you can test your EA on multiple pairs simultaneously. This is crucial for portfolio-based EAs. Use the Strategy Tester's "Forward Testing" mode to simulate real-time conditions.
Real Tick Data
Always use "Every tick based on real ticks" in MT5 Strategy Tester. This uses actual recorded tick data from the broker, giving you the most accurate simulation possible. The results will be significantly different from "Open prices only" mode.
Pro Tips from 29 Years Experience
These are hard-won lessons that I wish someone had shared with me when I started:
- Start with one pair — Master EUR/USD with your EA before adding more pairs. Each pair has its own personality and the EA may need different settings.
- Keep a performance spreadsheet — Track monthly returns, max drawdown, number of trades, and win rate. After 6 months, you will have meaningful data to evaluate.
- Update your EA regularly — We release updates to EA Semi-Auto when market conditions change significantly. Always use the latest version.
- Do not micro-manage — If you approved a trade, let the EA manage it. The biggest profit killers I see are traders who close winning trades too early because of fear.
- Schedule weekly reviews — Every Sunday, review the past week's trades. Look for patterns. Are certain sessions more profitable? Are there pairs where the EA underperforms? Use this data to refine your settings.
Frequently Asked Questions
Where do I find the MQL5 Experts folder in MT5?
In MetaTrader 5, go to File → Open Data Folder. Then navigate to MQL5 → Experts. This is where all EA (.ex5) files must be placed. After copying, restart MT5 for the EA to appear in Navigator.
Why is my EA not showing in the Navigator panel?
Three common causes: (1) Wrong folder — must be in MQL5/Experts. (2) Wrong file extension — must be .ex5 for MT5. (3) You need to restart MT5 after copying.
Do I need a VPS to run an EA 24/7?
For semi-auto EAs like ours, a VPS is optional since you approve each trade manually. For fully automatic EAs, a VPS is recommended. XM offers a free VPS for qualified accounts.
Can I run multiple EAs on one MT5 account?
We strongly advise against it. Multiple EAs can conflict with each other. Use one EA per account for best results.
What happens if my internet disconnects while the EA is running?
If the EA has already placed a trade with stop loss and take profit, those orders stay on the broker's server. However, the EA cannot send new signals while disconnected.
Conclusion
Setting up an Expert Advisor on MetaTrader 5 is straightforward when you follow the right steps. The key is preparation — having the right account type, placing files in the correct folders, and configuring settings properly before going live.
Remember: the EA is a tool, not a magic money machine. It works best when combined with proper risk management, realistic expectations, and ongoing monitoring. Start with a demo account, prove the system works for you, then transition to live trading with conservative risk settings.
With XM's excellent execution, tight spreads, and our EA Semi-Auto, you have everything you need to start your automated trading journey. The setup takes 15 minutes. The potential impact on your trading could last a lifetime.
Forex Trading in Kenya
Kenya is East Africa's leading hub for retail forex trading, supported by the Capital Markets Authority (CMA) regulatory framework. With Nairobi emerging as a regional fintech centre, Kenyan traders have access to world-class trading infrastructure. M-Pesa integration makes deposits and withdrawals seamless for local traders. XM offers KES-compatible payment methods with a minimum deposit of just $5. The East Africa Time (EAT, GMT+3) timezone aligns well with the London session from 10:00 AM to 7:00 PM EAT, providing optimal liquidity for major currency pairs and gold. The growing community of professional traders in Kenya makes it an exciting market for both beginners and experienced traders.