Lesson 5. Install & Basic Configure an EA on MT5 — Step by Step
Place EA files correctly, attach to a chart, enable AutoTrading, check status/logs, load presets, set lot/risk and time filters, and understand GMT/server time and magic numbers.
You learned how MT5 'holds' robots. Now let's install and run one safely on a demo account.
5.1. Place EA files correctly (MQL5/Experts) and refresh
- In MT5: File → Open Data Folder.
- Navigate to MQL5/Experts. Put your EA file here:
- • If you have .ex5 (compiled) → copy to MQL5/Experts.
- • If you have .mq5 (source) → copy to MQL5/Experts, then compile in MetaEditor (F7) to produce .ex5.
- Go back to MT5: in Navigator → Expert Advisors, right-click → Refresh. If the EA doesn't appear, restart MT5.
- Keep EAs from trusted sources only.
- Do not enable DLL imports for unknown EAs.
5.2. Attach EA to a chart and enable trading (global + local)
- Open a chart (e.g., EURUSD M15).
- Global switch: toolbar "AutoTrading" must be ON (green).
- Attach EA: Navigator → Expert Advisors → drag EA to chart.
- In the settings dialog:
- • Common/Inputs tabs vary by EA; ensure "Allow algo trading" is checked (EA-level permission).
- • DLL/WebRequest only if you trust and need them (off by default).
Status Check:
MT5 shows EA name and a small status icon/label on the chart; also see Experts tab for startup logs.
Common Pitfalls:
- Global AutoTrading OFF → no trades.
- EA-level "Allow algo trading" OFF → no trades.
- Market closed → no ticks → EA idle.
5.3. Inputs & presets: lots, risk %, magic number, time filters
Fixed lot (e.g., 0.10) or Risk % per trade (e.g., 0.5%). For beginners: risk % (0.25–1%) is safer.
Unique identifier per EA instance; use a different number on each chart (e.g., 5001 for EURUSD M15, 5002 for XAUUSD H1).
Trading allowed hours/days; avoid rollover (broker midnight) and high-impact news windows.
Max spread, slippage, order comment, ATR/dynamic stops (if present).
Load/Save .set files from Inputs tab ("Load…" to apply presets; "Save" to reuse settings).
Safety Notes:
- Keep risk small (0.25–1%).
- Never share .set files that contain API keys or personal URLs.
5.4. Time matters: server time vs GMT, rollover and news
- MT5 shows server time in charts and logs; it can differ from GMT by several hours and may change with DST.
- To set time filters correctly:
- • Check your broker's server time now (see bottom status bar / Market Watch time).
- • Calculate offset from GMT (e.g., server = GMT+2 in winter).
- • Set EA trading windows in server time (e.g., avoid 23:50–00:10 server time for rollover).
- High-impact news (NFP, CPI, rate decisions) can widen spreads/slippage; many EAs provide "blackout" minutes before/after news — use them if available.
5.5. Logs & diagnostics: Journal vs Experts, common errors
Toolbox → Experts
EA logs (initialization, signals, order results, errors).
Toolbox → Journal
Terminal/broker connection and trade events/errors.
| Error | Fix |
|---|---|
| "AutoTrading disabled" | Turn ON global and EA-level permissions. |
| "Trade is not allowed" | EA permission off; market closed; symbol trade disabled; Tools → Options → Expert Advisors global settings. |
| "Invalid stops" | SL/TP too close; check symbol's minimum stop distance in Symbol Specification. |
| "Not enough money" | Lot too large; reduce risk/lot size. |
| "No prices" / "Market closed" | Wait for session open; try a different symbol. |
5.6. Multiple instances: unique magic numbers on several charts
- You can run the same EA on multiple charts/symbols/timeframes.
- Each instance must have a unique MagicNumber to avoid order-mixing.
- Example: Attach EA to EURUSD M15 (Magic 7001) and XAUUSD H1 (Magic 7002). Each instance manages its own trades only.
5.7. Practice: install, attach, configure, verify (10–15 min)
Lesson 5 Quiz
Test your understanding with 3 questions. Pass with 2/3 correct.
What's Next?
You've installed an EA, attached it to a chart, configured key inputs like magic number and risk, and verified logs. Next, we'll run honest backtests — the first real test of whether your strategy has potential.
Next: Honest Backtests in MT5