What is an Expert Advisor?
An Expert Advisor (EA) is an automated trading program that runs inside MetaTrader 4 or MetaTrader 5. Written in MQL4 (for MT4) or MQL5 (for MT5), an EA monitors market conditions, applies a defined strategy, and places, modifies, or closes orders automatically without requiring the trader to be at a screen.
EAs are the primary reason MT4 has persisted in use despite MT5’s release in 2010 — the MQL4 ecosystem accumulated hundreds of thousands of strategies over two decades, and many traders have live-verified EAs they are not willing to migrate.
How EAs work
An EA runs as a process within the MetaTrader terminal (desktop or VPS). It hooks into the terminal’s price feed, has access to the full order API, and executes on each new price tick or candle close depending on how it is written. Key components:
- OnTick() or OnBar() — the main event handler that fires each tick or candle
- Order functions — OrderSend(), OrderClose(), OrderModify() for placing and managing trades
- Indicator functions — iRSI(), iMACD(), iMA() etc. for reading technical indicators
- Risk management — position sizing, stop-loss, and take-profit are set in code
Why 95% of EAs sold in the market lose money
The most common failure mode: overfitting. A backtested strategy that produces a beautiful equity curve on historical data often fails on live markets because the strategy parameters were optimised for specific past conditions that do not repeat. This is called “curve-fitting” or “overfitting.”
Other common failure modes:
- Data quality: backtests run on 1-minute bars instead of tick data miss slippage and spread widening
- Broker latency: a strategy that wins in backtests assumes zero-slippage execution that does not exist on live markets
- Market regime changes: a strategy that exploits a 2019–2021 low-volatility trend regime fails in the 2022+ high-volatility environment
How to evaluate an EA before using it
- Request tick-data backtests (not M1 OHLC approximations) over at least 5 years
- Ask for out-of-sample performance (tested on data the strategy was NOT optimised on)
- Check live account track record with a verified third party (Myfxbook, FX Blue) — not screenshots
- Check maximum drawdown, not just total return
- Understand the risk model: does the EA use martingale (doubling position on loss)? If yes, it will eventually blow the account
See also: MetaTrader 4 review · MT4 vs MT5 mobile · ECN/STP explained