بواسطة William Harris · آخر مراجعة
How to Install an Expert Advisor in MetaTrader 5 (2026 step-by-step)
ما ستحتاجه
- • MetaTrader 5 already installed (see install-mt5)
- • The Expert Advisor file (.ex5 compiled binary)
- • Preset file from the vendor (.set, optional)
- • Trading account with permission to trade the EA's symbol
تعليمات خطوة بخطوة
الخطوة 1: Verify the EA file is genuine and not blocked
Expert Advisors for MT5 are distributed as .ex5 files (compiled bytecode). Sometimes vendors ship a .mq5 file (source code) — that compiles to .ex5 on first launch, but only if MetaEditor is installed; if you only have MT5 the .ex5 path is safer.
On Windows, right-click the downloaded .ex5 file → Properties. If you see a 'This file came from another computer and might be blocked' notice at the bottom, tick 'Unblock' and click OK. Otherwise Windows treats the file as untrusted and MT5 refuses to compile it.
If the file came as a .zip or .rar archive, extract it first. Do not load a .zip file into the data folder — MT5 will not auto-extract it. If the archive contains multiple files (often: the .ex5, a .set preset, a PDF manual, and a custom indicator .ex5), keep them grouped — the indicator usually has to be deployed in parallel.
الخطوة 2: Open the MT5 data folder
In MT5, choose File → Open Data Folder. Windows Explorer (or Finder on Mac via the Wine wrapper) opens at the per-installation data folder. The path looks like C:\Users\<you>\AppData\Roaming\MetaQuotes\Terminal\<hash>\.
The critical sub-folders are: MQL5\Experts\ (EAs), MQL5\Indicators\ (custom indicators, often required as a dependency), MQL5\Presets\ (vendor .set files), and MQL5\Files\ (some EAs read auxiliary data here).
Leave the Explorer window open — you will copy files into it and then return to MT5.
الخطوة 3: Copy the EA and any dependencies into the data folder
Drag-and-drop the EA's .ex5 file into MQL5\Experts\. If the vendor packaged a custom indicator, drop that .ex5 into MQL5\Indicators\. If they shipped a .set preset, drop it into MQL5\Presets\.
File placement is strict: an EA file in MQL5\Indicators\ will not show up in the EA list. A preset in MQL5\Files\ will not be discoverable from the load-preset dropdown. If the vendor's installation guide says 'place the .ex5 in MQL5\Experts\YourBrand\' (a sub-folder), respect that — it's purely organisational, but the vendor's setup scripts may look for it.
Never rename the .ex5 file. The internal Magic Number that MT5 uses to identify EA-placed orders includes a hash of the filename — renaming silently breaks order tracking for the EA's own trades.
الخطوة 5: Attach the EA to a chart
Open a chart of the symbol and timeframe the EA expects. The vendor's documentation should specify both: e.g. 'EURUSD M5' or 'XAUUSD H1'. Symbol mismatch is the most common 'EA does not trade' cause — most EAs check `Symbol()` on load and silently exit if it is wrong.
Drag the EA from the Navigator panel onto the chart. A popup opens with three tabs: Common, Inputs, and Dependencies (the last only for some EAs).
On the Common tab, check 'Allow live trading' and 'Allow modification of Signal Settings'. Leave 'Disable auto-trading when the account has been changed' ticked — it is a safety guard. The 'Allow algorithmic trading' setting at the global toolbar level overrides per-chart settings, but you need both on for the EA to actually place orders.
الخطوة 6: Load the vendor preset (.set file)
Switch to the Inputs tab in the popup. By default the EA shows its compiled defaults. To load a vendor-recommended .set file, click the Load button at the bottom and pick the .set from MQL5\Presets\.
The Inputs tab now shows the parameters from the .set. Scan them for anything that mentions Magic, LotSize, or RiskPercent. Magic should be a unique integer for this EA on this account — if you are running multiple EAs, they must all have different Magic Numbers, or they will conflict when reading their own positions.
Risk-related inputs (lot size, risk percentage, max drawdown) should be reviewed against the actual account balance. A preset designed for a $10,000 account on a 1% risk-per-trade rule produces trades 10× too large on a $1,000 account.
الخطوة 7: Enable AutoTrading and verify the EA loaded
Click OK to dismiss the popup. The EA is now attached but not yet trading because AutoTrading is master-disabled at the toolbar level by default.
Look at the top toolbar for the 'AutoTrading' button (a small triangle icon, usually orange/grey). Click it. The icon turns green and a green smiley face appears in the top-right corner of the chart, next to the EA name. If you see a red sad face instead, hover over the EA name to read the reason: common causes are 'Trading not allowed in EA properties' (re-open the popup and tick the box), 'Symbol mismatch', or 'No connection to server'.
The Experts tab at the bottom of the terminal shows EA initialisation messages. A healthy EA logs an OnInit complete message. After that, watch the chart for the first signal. Most EAs only trade during specific session windows, so don't panic if nothing happens for the first hour.
أخطاء شائعة يجب تجنبها
- ✗ Dropping the .ex5 in the Program Files MT5 folder instead of the Roaming data folderإصلاح: MT5 will not scan the Program Files install path for user EAs. Always use File → Open Data Folder.
- ✗ Wrong Magic Number — two EAs share the same Magic and start fighting over the same ordersإصلاح: Set a unique Magic per EA per chart. The 'official' convention is the EA's product ID + chart symbol code, but any unique integer works.
- ✗ Forgetting to enable global AutoTrading after enabling per-chartإصلاح: Both must be on. Global is the orange-to-green toolbar button; per-chart is the green smiley on the chart.
- ✗ Symbol name mismatch (e.g. XAUUSD vs GOLD vs XAU/USD)إصلاح: Check the exact symbol name in your broker's Market Watch. If the EA hard-codes XAUUSD but your broker calls it GOLD, contact the vendor for a symbol-override input.
- ✗ Custom indicator dependency missing — EA throws 'Cannot load indicator'إصلاح: Re-read the vendor's package contents. Any custom indicator the EA uses must be in MQL5\Indicators\ alongside the EA in MQL5\Experts\.
- ✗ Running an EA on a Cent account when the preset assumes Standard lot sizingإصلاح: Cent accounts treat 1 lot as 1000 units (vs 100,000 on Standard). A 0.1-lot preset opens 100× the intended exposure. Reduce LotSize 100×.
الأسئلة الشائعة
I attached an EA but it is not placing any trades — what should I check?
If the smiley is red, the most common reasons are: trading disabled in EA properties (re-open inputs tab), global AutoTrading off (orange icon, click to make green), or account-changed safety lock triggered (untick and re-tick the AutoTrading toolbar button). If the smiley is green but no trades appear, examine the Journal tab and the EA's own log output — a healthy EA logs reasoning for not trading, like 'Volatility below threshold' or 'Outside trading session'.
Can I run multiple EAs on the same chart?
The 'one EA per chart' rule is enforced at the terminal level — dragging a second EA onto a chart that already hosts one prompts 'Do you want to replace the current Expert Advisor?'. The workaround is multiple charts, each with its own EA and its own Magic Number. For high-frequency setups with 5–10 EAs you'll eventually want a multi-monitor display, or run the EAs on a VPS where chart layout doesn't matter visually.
Why does my paid EA say 'Account not licensed' on a new MT5 install?
The licence check usually happens during OnInit and compares AccountInfoInteger(ACCOUNT_LOGIN) against a server-side allowlist. The vendor's account page shows current bindings; some include a self-service 'release binding' button, others require email to support. Demo accounts are usually free to add and don't count against the binding limit. Always check the licence terms before buying — some vendors are strict 1-account-only, others are permissive.
The vendor shipped a .set file but my EA's inputs do not match — is the .set wrong?
Check the version line in the Experts tab of the terminal — most EAs print 'EAName v3.2 initialised' on load. The vendor's product page usually lists the .set files by version (e.g. 'preset-v3.2-conservative.set'). If only an older .set is available, manually translate the most important inputs (lot size, magic, time filters) into the new EA's inputs and ignore the rest.
Does it matter which chart timeframe I attach the EA to?
Inside the EA, code often calls `PERIOD_CURRENT` to read the chart timeframe; switching timeframes changes everything from how indicators initialise to how trailing-stop distances are computed. The .set preset is also calibrated against a specific timeframe — a Scalperology M1 preset on an M15 chart produces 1/15 the signal frequency at the wrong stop sizes. Always match the timeframe to the vendor's documentation.
Can I install an EA bought from the MQL5 Market on multiple computers?
The 5-activation limit refreshes via Tools → Options → Market → 'Reset activations' once per 30 days. Each Mac/PC/VPS counts as one activation; reinstalling the OS or moving to a new drive often uses an activation. If you hit the limit before 30 days, contact MetaQuotes support — they will manually reset it once. Self-hosted EAs (bought outside MQL5 Market) follow whatever licensing scheme the vendor uses; some count by account, some by machine, some are unrestricted.
EA running — what's next?
Before going live, backtest the EA against historical data with the .set preset you just loaded. The MT5 Strategy Tester takes about 10 minutes to set up.
Continue to: How to backtest an EA in MT5 →أدلة ذات صلة

William Harris
المؤسس وكبير المطورين في FxRobotEasy
شيكاغو، الولايات المتحدة · منذ 2021
- 12+ عاماً من التداول الحي
- 10+ سنوات MQL5 / MQL4
- 3 Expert Advisors معتمدة حياً
- تأسست في 2021
“أبني الأشياء بالبرمجة منذ المدرسة الإعدادية. أتداول منذ الجامعة. تقاطع هذين العالمين — الخوارزميات والأسواق والتكنولوجيا التي تربطهما — هو حيث قضيت السنوات الخمس عشرة الماضية. FxRobotEasy هو ما يحدث عندما ترفض التوقف حتى يعمل ما تخيلته فعلاً على حساب وسيط حي.”