Quick answer: An Expert Advisor (EA) is a program that runs inside MetaTrader and trades according to coded rules, without a human clicking buy or sell. It reads incoming price data, checks the conditions its author wrote — an indicator crossover, a breakout level, a time window — and sends orders to the server when those conditions are met. An EA does not predict the market; it repeats one set of rules faster and more consistently than a person can, which helps when the rules are sound and hurts when they are not.
Automation removes hesitation, fatigue and the temptation to widen a stop. It also introduces code errors, strategies fitted to past data, and systems that keep trading through conditions they were never designed for.
What’s Included in This Article
This guide covers what an Expert Advisor is, how automated execution works, the main types of EA, where they run on MT4 and MT5, how backtesting and forward testing work, which costs decide the outcome, the red flags, and a pre-launch checklist.
What Is an EA in Trading?
An EA in trading is an automated system attached to a chart in the MetaTrader terminal. It is written in MQL4 or MQL5 and reacts to events — a new tick, a timer, a chart change — through handler functions. Beyond calculating signals, EAs send orders directly to the trading server and are stored in the terminal’s Experts folder, according to the MQL5 reference.
- The EA is only as good as its rules. There is no judgement layer. If the rules say buy every 20/50 moving average crossover, that happens in a trend and in a chop.
- It has to be running. A standard EA executes inside your terminal, so the terminal must be open and connected. Traders who need continuity use a VPS.
- It trades under your account conditions. Two people running identical code get different results, because spread, commission and execution differ.
EA, trading bot, algo and forex robot all describe the same thing. “Expert Advisor” is MetaTrader’s name for it.
How Automated Trading Works
Every EA cycle follows four steps, however sophisticated the strategy.
- Data in. The terminal receives a price update and passes it to the EA.
- Signal logic. The code evaluates indicator values, price levels, spread filters, time of day and open positions.
- Order sending. If conditions pass, the EA builds an order — symbol, direction, lot size, stop loss, take profit — and sends it to the server.
- Position management. On later ticks it may move a stop to breakeven, trail it, close on an opposite signal, or scale out.
The server, not the EA, decides the fill. Requotes, slippage during news and weekend gaps happen after the order leaves the terminal, which is why identical code produces different equity curves at different execution speeds.
Types of EAs and Common Strategy Families
Not everything marketed as a robot trade forex tool actually opens positions on its own. Three categories are worth separating.
| Category | What it does | Who it suits |
|---|---|---|
| Fully automated EA | Finds signals, opens, manages and closes positions | Hands-off execution of a defined system |
| Semi-automated / signal EA | Flags setups or draws levels; you confirm | Discretionary traders wanting a filter |
| Trade manager utility | Handles stops, trailing and partial closes on manual trades | Traders whose weakness is exits |
The underlying logic usually belongs to one of a few families:
- Trend following. Moving averages, breakouts, momentum filters. Few winners, larger average win, long flat periods.
- Mean reversion. Fades stretched moves back toward an average. High win rate, occasional large loss when the move continues.
- Grid and martingale. Adds positions against the first entry, often increasing size. Curves look smooth until one sustained trend removes the account — the highest-risk family, not a conservative one.
- Scalping. Many small trades on short timeframes, highly sensitive to spread and latency. A system that profits at 0.2 pips can lose at 1.0.
Where EAs Run: MT4 and MT5
EA trading happens inside the MetaTrader terminal, and both versions support it with different tooling. FXPrimus offers MT4 and MT5, and code is not interchangeable — an MQL4 file will not run on MT5 without being rewritten.
| Feature | MT4 (MQL4) | MT5 (MQL5) |
|---|---|---|
| EA language | MQL4 | MQL5 |
| Strategy tester | Single-threaded, single symbol | Multi-threaded, multi-symbol, cloud agents |
| Tick modelling | Modelled from M1 bars | Includes real tick history mode |
| Order accounting | Hedging | Netting or hedging, by account |
| Third-party EA library | Large legacy catalogue | Growing, plus native MT5 development |
MT4 has the deeper catalogue of existing EAs because of its head start. MT5 has the stronger testing environment, which matters more if you plan to develop or validate a system seriously. Both appear on the FXPrimus platforms page.
Backtesting: What It Proves and What It Doesn’t
Backtesting runs an EA over historical data to see how its rules would have behaved. In MetaTrader this happens in the Strategy Tester, where the EA processes stored quotes and performs virtual transactions according to its algorithm, per the MetaTrader 5 documentation.
The answer is only as good as the simulation. MT5 offers several tick generation modes, from open prices only through M1 OHLC to real tick history, trading speed against accuracy — the MQL5 testing documentation describes how each builds its tick sequence. A scalping EA tested on open prices only is not tested at all.
A backtest shows whether the logic runs without errors, how often it trades, and the shape of the drawdown. It cannot show how the system handles real slippage, or whether the parameters were tuned to the past rather than discovered in it.
Optimisation is where most systems break. Testing hundreds of parameter combinations and keeping the top performer produces a curve fitted to history: impressive in the report, fragile live. Reserve a slice of history the optimiser never sees, then check the chosen settings on it.
Forward testing on a demo account is the next step: real spreads, real gaps, real weekends. Run it for several weeks and compare the log against the backtest. Demo still flatters a system, so treat a clean period as permission to test small.
Costs and Conditions That Decide the Outcome
For frequent strategies, trading costs decide the outcome, and they are the part most often ignored when evaluating a trading forex robot.
- Spread. The main cost on most accounts. A system averaging 6 pips per winning trade gives up a meaningful share of its edge to a 1.5-pip spread.
- Commission. Raw-spread accounts trade a tighter spread for a per-lot fee; whether that helps depends on trade size and frequency.
- Swap. Overnight financing quietly reshapes any strategy holding positions for days.
- Slippage and latency. Backtests assume you get the price, and distance to the server matters for short-term systems — one reason EA users run a VPS.
Compare the conditions your EA was tested under with the account you plan to run it on: the fees and leverage page lists current costs and leverage ratio limits by account type.
Risks and Red Flags
Automation does not reduce market risk; it removes the delay between a bad rule and a filled order.
- Curve fitting. A near-straight equity line with a tiny drawdown over ten years is a warning sign, not a selling point.
- Hidden martingale. Ask whether the EA increases lot size after a loss. Vendors call it “recovery mode” or “smart averaging”.
- No hard stop loss. Systems that manage risk only by closing on an opposite signal have no defined worst case.
- Unverifiable claims. Vendor screenshots are not audited records. Ask for read-only live account history and treat self-reported figures accordingly.
- Black-box logic. If nobody can explain in a paragraph why the strategy should make money, you cannot judge when it has stopped working.
- Sizing detached from balance. An EA defaulting to 1.00 lot on a small account can put a leverage ratio of 1:500 to work against you in one session.
A Practical Checklist Before Going Live
- Understand the strategy in plain language — entry, exit, risk cap, and the market condition it needs.
- Confirm a hard stop loss on every position the EA opens.
- Backtest with the highest-accuracy tick model available, over several years including a volatile period, then validate on data the optimiser never saw.
- Forward test on demo for several weeks under live spreads, then start live at minimum size.
- Set an intervention rule — the drawdown level or losing streak at which you switch the EA off — and check the economic calendar for events your system has never traded through.
The FXPrimus Beginner’s Academy covers the lot sizing, margin and stop placement these steps assume.
Frequently Asked Questions
What is an EA in trading?
An EA, or Expert Advisor, is a program that runs inside MetaTrader and executes a strategy automatically. It reads price data, applies coded rules and sends orders without manual clicks. The same thing is often called a bot, algo or forex robot.
Do forex robots actually make money?
Some do and many do not. An EA reproduces its rules faithfully; profitability depends on whether those rules hold an edge after spread, commission, swap and slippage. No automated system guarantees profits, and backtest results do not predict future performance.
Do I need to code to use an EA?
No. Existing EAs install by copying the file into the terminal’s Experts folder and attaching it to a chart. Coding knowledge lets you audit the logic instead of trusting a description.
Can EAs run on both MT4 and MT5?
Both support EA trading, but MQL4 files run on MT4 and MQL5 files on MT5. An EA written for one version must be rewritten for the other. MT5 has the more capable strategy tester.
Does my computer need to stay on?
Yes for a standard EA, since it executes inside your terminal. If the terminal closes or loses connection, the EA stops managing positions. Many traders use a VPS to stay online.
Is automated trading allowed?
EA use is permitted on MetaTrader accounts at most brokers, including FXPrimus. Specific techniques such as latency arbitrage may be restricted, so review the terms and conditions for your account first.
How long should I backtest an EA?
Long enough to include different conditions — typically several years covering trending, ranging and high-volatility periods. A test spanning only a favourable stretch tells you nothing about the rest.
Conclusion
An Expert Advisor is an execution tool, not a source of edge. Consistent rule-following is valuable when those rules are tested and the risk cap is hard-coded, and dangerous when the strategy was fitted to history or sizes positions without limit. The work sits in understanding the logic, testing it on high-quality data, forward testing on demo, and starting live at a size where being wrong is survivable.
Key Takeaways
- An EA is a MetaTrader program that applies coded rules and sends orders automatically; it does not forecast the market.
- MQL4 code runs on MT4 and MQL5 on MT5 — not interchangeable, and MT5 has the stronger tester.
- Backtest accuracy depends on tick modelling; results optimised on the same data they were tested on mean little.
- Spread, commission, swap, slippage and latency determine whether a short-term system keeps its edge.
- Martingale sizing, missing stop losses and unverifiable vendor claims are the clearest red flags.
- Automated does not mean unattended: decide in advance the drawdown level at which you switch the system off.
Want to test an EA yourself? MetaTrader 4 and MetaTrader 5 are both available at FXPrimus — see the platforms page for details, and run any system on demo before committing capital.
Risk warning: Trading forex and CFDs involves a significant risk of loss and is not suitable for all investors. CFDs are complex products traded on margin, and high leverage ratios such as 1:100 or above can amplify both gains and losses. Automated trading systems carry additional technical risks, including connectivity failures and coding errors. Trading conditions referenced are indicative, self-reported by FXPrimus, checked as of August 2026 per the live platform, and subject to change. Past performance does not guarantee future results. This article is provided for informational and educational purposes only and does not constitute financial advice, legal advice or tax advice. Review the full terms and conditions on the FXPrimus website before opening an account.