EA basics
How to Install and Run an Expert Advisor on MT5: A Safe, Step-by-Step Guide
By Benjamin Lee · Updated · 9 min read
An Expert Advisor (EA) is a program that trades your MetaTrader 5 account by rules. It never gets tired, but it also never questions a bad setting. Most blown accounts come from setup mistakes, not from the strategy itself. This guide walks through installing an EA, loading its setfile, choosing risk limits, and staging it from demo to live without surprises.
Key takeaways
- Check your account type (hedging or netting) and symbol name before you install anything.
- Always load the vendor's setfile, then change risk inputs deliberately, one at a time.
- Run on demo, then on a small live account, before you scale the lot size.
- A drawdown of 50% needs a 100% gain to recover. Cap your risk per trade accordingly.
- Use a VPS for continuity, and review the EA's journal logs every week.
What an Expert Advisor does (and does not do)
An EA is a compiled MQL5 program (a .ex5 file) that runs inside the MetaTrader 5 terminal. It reads prices and indicators on the chart it is attached to, applies a fixed set of rules, and sends orders to your broker on your behalf. Entries, exits, position sizing, and trade management are all automated.
What it does not do is think. An EA has no view on a surprise central bank statement, a broker server outage, or the fact that spreads on gold triple at the daily rollover, unless the author coded a rule for it. That is why the quality of the inputs you choose matters as much as the quality of the strategy you bought.
- 24/5
- Hours the EA can watch the market, if the terminal stays online
- 1 chart
- Most EAs attach to one symbol and timeframe at a time
- 3 files
- Typical delivery: .ex5 program, .set preset, user manual
Before you install: four checks that prevent most problems
Check each item in the table below against the EA's product page or manual before you install.
| Check | Where to look | Why it matters |
|---|---|---|
| Account type | Navigator, then right-click your account, or the broker's account details | Hedging accounts allow opposite positions on the same symbol. Netting accounts merge them. Grid and hedge EAs usually need hedging. |
| Symbol name | Market Watch (Ctrl+M) | Brokers add suffixes such as XAUUSD.m or XAUUSDx. Some EAs need the exact symbol set in their inputs. |
| Spread and commission | Market Watch, with Spread column shown | Scalpers can be unprofitable on wide spreads. Compare the live spread with the spread assumed in the EA's manual. |
| Leverage and minimum lot | Right-click the symbol, then Specification | A small account may not be able to open the minimum lot size the setfile expects. |
Step-by-step: install the EA in MetaTrader 5
The procedure is the same on any MT5 broker. You are copying one file into the right folder and telling the terminal that automated trading is allowed.
Step 1: Download and unzip the product
Extract the archive from your order page. You should see the .ex5 file, a .set preset file, and a PDF manual. Keep them together.
Step 2: Open the data folder
In MT5 choose File, Open Data Folder, then go to MQL5, Experts. This is where the terminal looks for EAs.
Step 3: Copy the .ex5 file in
Paste the program into the Experts folder. Putting it in a subfolder is fine and keeps things tidy.
Step 4: Refresh the Navigator
Press Ctrl+N to open the Navigator, right-click Expert Advisors, and choose Refresh. The EA name should appear in the list. If it does not, restart the terminal.
Step 5: Open the right chart
Open a chart of the symbol and timeframe named in the manual (for example XAUUSD on M15). Using a different timeframe is a very common reason an EA behaves unlike its screenshots.
Step 6: Attach and allow trading
Drag the EA onto the chart. On the Common tab tick Allow Algo Trading. Click OK, then make sure the Algo Trading button in the top toolbar is green.
Step 7: Confirm it is alive
A small hat or smiley icon appears in the chart's top-right corner. Open the Experts tab at the bottom of the terminal. You should see an initialisation message, not an error.
Load the setfile and understand the inputs
A setfile is a saved list of input values, built by the author for a given symbol and risk profile. Loading it is the quickest way to get a safe, documented starting point. On the EA's Inputs tab, click Load and choose the .set file. Every field updates at once.
Do not skim the inputs after loading. Read each group and compare it with the manual. Most EAs expose some version of the following settings.
| Input | What it controls | Beginner guidance |
|---|---|---|
| Lot size or risk % | How big each position is | Prefer risk % where offered. Start at 0.25 to 0.5% per trade and scale only after weeks of live data. |
| Magic number | The ID the EA uses to recognise its own trades | Give every EA instance a unique number. Two EAs sharing a number can close each other's trades. |
| Max spread | Blocks entries when the spread is too wide | Keep this on. It protects you at rollover and during news. |
| Trading hours | Sessions in which the EA may open trades | Remember times use broker server time, not your local time. |
| Daily or equity stop | Stops trading after a set loss | Enable it. It is your circuit breaker when conditions change. |
| Max open trades | Caps the number of simultaneous positions | Critical for grid systems. Never remove it. |
Risk settings: why drawdown math rules everything
New users often ask which EA makes the most money. A more useful question is how large a drawdown you can survive, both financially and emotionally. Losses are not symmetrical: if your account falls 50%, you need a 100% gain to get back to the start.
- 10% loss+11.1%
- 20% loss+25%
- 30% loss+42.9%
- 50% loss+100%
- 70% loss+233%
Try the calculator below with the drawdown you think you could tolerate. Then work backwards: choose a position size at which a long losing streak still lands inside that number.
Interactive: drawdown recovery
Gain needed to get back to break-even
+42.9%
Blue: equity left. Red: equity lost.
Consecutive losing trades to reach this drawdown: 36
Many traders keep risk well under 1% of equity per trade and cap the total open risk across all positions. A worked example on gold: with a 5,000 USD balance and 0.5% risk, you accept a 25 USD loss per trade. If the EA's stop sits 5 USD from entry and one standard lot of XAUUSD moves 100 USD per 1 USD (confirm the contract size in your broker's specification), the stop costs 500 USD per lot, so the size is 25 ÷ 500 = 0.05 lot. If an EA uses a grid or averaging, the relevant number is the combined risk of the whole basket, not one order. The EA strategy comparison explains why.
Stage it: demo, small live, then scale
Even a well-tested EA needs to prove it behaves on your broker, with your spreads, your latency, and your symbol settings. A staged rollout is the cheapest insurance available.
- Demo for two to four weeks. Confirm the EA opens trades when expected, respects your spread filter, and closes trades as the manual describes. Compare behaviour against the backtest you ran.
- Small live account. Use an amount you can afford to lose entirely and the smallest sensible lot. Real fills, slippage and commission show up here for the first time.
- Scale slowly. Increase size only after a meaningful sample of trades and only in modest steps. If live behaviour diverges from demo, stop and investigate before scaling.
Keep it running: VPS and uptime
An EA only trades while the terminal is open and connected. A laptop that sleeps, a home router that reboots, or a power cut can leave open positions unmanaged. A Virtual Private Server solves this by running MT5 in a data centre, ideally close to your broker's trade server for lower latency.
- MetaQuotes VPS. Right-click your account in the Navigator and choose Register a Virtual Server. It migrates your charts, EAs and settings in one step and is the simplest option for MT5.
- Windows VPS from a hosting provider. More flexible, since you can run several terminals or extra tools, but you install and secure MT5 yourself. Use strong credentials and keep Windows updated.
- Never run on a shared or public computer. Your trading credentials and EA files should live only on machines you control.
Monitor like a professional
Automation does not remove the need for oversight. It changes the job from clicking buttons to checking that the system still behaves as designed. A weekly ten-minute review catches nearly every problem early.
- Read the Experts and Journal tabs for repeated errors such as requote, invalid stops, or not enough money.
- Compare the current drawdown with the worst drawdown seen in the backtest. Live drawdown well beyond it is a warning sign.
- Check average spread and slippage on closed trades, not just profit.
- Note any broker changes, such as a new commission, a new server, or an update to leverage.
- Update the EA when the vendor releases a new version, and re-check the setfile, since defaults sometimes change between versions.
Seven mistakes that cost beginners money
- Skipping the setfile. The default inputs are rarely tuned for your symbol.
- Running the wrong timeframe. The strategy was designed for one, so use it.
- Using the same magic number on two EAs. Each can manage the other's positions.
- Over-leveraging after a winning week. Position size should follow rules, not mood.
- Switching EAs after every small loss. Judge a system over a statistically meaningful sample.
- Ignoring news and rollover. Pause or filter around high-impact events if the author recommends it.
- Believing marketing screenshots. Verify with your own demo and backtest data.
Frequently asked questions
Do I need a VPS to run an Expert Advisor?
Not strictly, but any interruption to your terminal or internet connection can leave positions unmanaged. A VPS keeps MetaTrader 5 running around the clock and is strongly recommended for any live account.
Why does my EA show a sad face or not trade?
The most common causes are the Algo Trading button being off, Allow Algo Trading unticked on the EA's Common tab, an unsupported symbol or timeframe, or a spread filter blocking entries. Check the Experts tab for the exact message.
Can I run several EAs on one MT5 account?
Yes, as long as each instance has a unique magic number and the combined risk across all of them stays within limits you set. Remember that on a netting account, opposite trades on one symbol are merged.
Should I use the default setfile or optimise my own?
Start with the author's setfile. Optimising on a short history often produces settings that look excellent in testing and fail live. If you do optimise, validate on out-of-sample data first.
How much money do I need to start?
It depends on the strategy and the broker's minimum lot. A smaller account forces larger relative risk per trade, so choose an account size that lets you stay at or below roughly 1% risk per trade.
Expert Advisors in these styles
Apply the checks above to any of these before you buy: read the manual, run your own backtest, and start on demo.
Keep reading
- BacktestingHow to Backtest an EA in MT5 ProperlyLearn how to backtest an Expert Advisor in MT5 the right way: tester modes, spreads, delays, optimisation, walk-forward checks and the red flags to avoid.
- Strategy comparisonWhich EA Strategy Wins Long Term?Compare MT5 Expert Advisor strategy types, from scalping and grid to hedging and arbitrage: how each earns, how each fails, and which tend to survive long term.


