Home › Learn › Expert-Advisors
MetaTrader 4 Expert Advisors Explained for Beginners
MetaTrader 4 Expert Advisors let you automate a trading strategy so trades are opened, managed and closed by code instead of your finger on the mouse. This guide explains what they actually are, how to install and test one safely, and why the real cost of trading matters just as much as the strategy itself.
What Are MetaTrader 4 Expert Advisors?
An Expert Advisor (EA) is a piece of software written in MQL4 that runs inside MetaTrader 4 and follows a fixed set of rules. Once attached to a chart and switched on, it can:
- Scan the market for a defined entry condition (e.g. a moving average cross, a breakout, an RSI level)
- Open trades automatically with a pre-set lot size, stop loss and take profit
- Manage open positions, including trailing stops, partial closes or hedging
- Close trades when an exit condition is met, without you clicking anything
EAs range from simple single-indicator systems to complex multi-currency portfolios. Some are free, some are sold commercially, and some are custom-built by a trader or developer for personal use.
The key thing to understand: an EA does exactly what it's coded to do — nothing more, nothing less. It has no judgement, no intuition, and no awareness of news events unless that's specifically coded in. It will keep following its rules in market conditions it was never designed for, which is exactly where many EAs come unstuck.
How to Install and Attach an EA
Getting an EA running in MetaTrader 4 is mechanically simple:
1. Copy the file — place the .ex4 file into the MQL4/Experts folder (via File → Open Data Folder)
2. Restart or refresh — right-click "Expert Advisors" in the Navigator panel and hit Refresh
3. Drag onto a chart — choose the correct currency pair and timeframe the EA was designed for
4. Enable AutoTrading — click the AutoTrading button in the toolbar so it turns green
5. Check the Experts tab — this log shows whether the EA loaded correctly or threw an error
A common beginner mistake is attaching an EA to the wrong timeframe or pair, or forgetting to enable AutoTrading — the EA will sit there doing nothing and you won't know why until you check the log.
Backtesting: What It Can and Can't Tell You
MT4's built-in Strategy Tester lets you run an EA against historical price data to see how it theoretically would have performed. This is useful, but it has real limitations:
- Tick data quality varies — older historical data, especially from your broker's own feed, can be patchy
- Spread is often modelled as fixed, when in reality it moves throughout the trading day
- Slippage isn't fully captured — real execution during volatile news can differ from a clean backtest fill
- Curve-fitting risk — a strategy tuned to perform perfectly on past data may fail on data it hasn't seen
Treat a good backtest as a reason to test further, not a reason to go live. Run the EA forward on a demo account for several weeks across different market conditions before considering real money.
Why Trading Costs Make or Break an EA
This is the part many beginners skip, and it's often the difference between a strategy that "should" work and one that actually does. Every trade an EA places pays:
- Spread — the gap between bid and ask, paid on every entry
- Commission — charged per lot on some account types, on top of spread
- Swap/rollover — daily charges (or credits) for positions held overnight
A scalping EA that aims for 3–5 pips per trade can be wiped out entirely by a spread that's a pip or two wider than assumed in the backtest. A grid or martingale-style EA that adds to losing positions is even more sensitive to costs, because drawdowns compound quickly.
Before running any EA live, model your actual costs using PipTax's [cost audit tool](/audit.html), and compare how spread, commission and swap stack up across brokers on the [brokers directory](/brokers/index.html). The methodology behind those comparisons is explained on the [methodology page](/methodology.html).
Choosing a Broker for Automated Trading
Execution quality matters more for EAs than for manual trading, because the EA can't judge whether a fill was reasonable — it just takes what the server gives it. When comparing brokers for EA use, look at:
| Factor | Why it matters for EAs | |---|---| | Execution speed | Slow servers cause slippage on fast-moving entries | | Spread consistency | Wide or spiking spreads during news can breach an EA's logic | | VPS availability | Keeps the EA running 24/5 without your PC needing to stay on | | EA/scalping policy | Some brokers restrict certain automated strategies in their terms |
Pepperstone and IG are both FCA-regulated and commonly used by MT4 traders running EAs, but their exact spreads, commissions and server conditions change and should never be assumed. Always check live figures on their broker pages via [PipTax's brokers directory](/brokers/index.html) rather than relying on old numbers.
Risk Controls Every Beginner Should Set
Before switching AutoTrading on with real funds, set these basic guardrails:
- Fixed or capped lot size — don't let the EA size up uncontrollably after wins
- Hard stop loss on every trade — never rely on a "mental" exit for an automated system
- Maximum daily/weekly drawdown limit — decide in advance when you'll turn the EA off
- Regular monitoring — check the Experts log and open trades at least daily
- One EA, one account, to start — don't run multiple untested EAs on the same account at once
If you're new to automated trading generally, it's worth working through the basics on the [PipTax school](/school/index.html) before combining several EAs or strategies.
Getting Started the Right Way
MetaTrader 4 Expert Advisors can remove emotion and manual error from a strategy, but they don't remove risk — they just automate whatever risk is already built into the rules. Start on a demo account, verify the logic makes sense to you, model your real trading costs before going live, and choose a broker with dependable execution rather than the flashiest marketing. Done carefully, an EA is a tool for consistency. Done carelessly, it's a fast way to automate losses at scale.
Key takeaways
- <parameter name="item">MetaTrader 4 Expert Advisors (EAs) are automated scripts that can open
- manage and close trades on your behalf using pre-set rules.