Expert Advisor
Also known as: EA, trading robot
Expert Advisor: An Expert Advisor (EA) is a program for MetaTrader that can analyse prices and open, manage and close trades automatically according to rules written in MQL4 or MQL5.
How does an Expert Advisor work?
An EA is attached to a chart and runs while the platform is open and connected, unless it is hosted on a remote server. It checks its conditions on each new price and sends orders when they are met. MT4 EAs are written in MQL4 and MT5 EAs in MQL5, so an EA for one platform does not run on the other: MQL4 and MQL5.
How are Expert Advisors tested?
MetaTrader’s Strategy Tester runs an EA’s rules on historical prices. A backtest shows how the rules would have performed under the test’s assumptions, such as spreads and fills; it does not show how they will perform in the future, and results can differ in live trading because of costs, slippage and changing market conditions.
Example
An EA that buys EUR/USD when a 20-period moving average crosses above a 50-period one, with a 30-pip stop loss and a 60-pip take profit, places and manages those orders without manual input. Whether the rule makes money depends on the market, not on the automation.
EAs sold with promises such as “guaranteed profits” may be warning signs of forex scams.
Learn more
- How to Use MetaTrader 4 (MT4): A Beginner's Guide
How to install and use MetaTrader 4 (MT4): logging in, opening trades, pending orders, stop loss and take profit, trailing stops, charts and Expert Advisors.
- How to Use MetaTrader 5 (MT5): A Beginner's Guide
How to install and use MetaTrader 5 (MT5): hedging and netting accounts, opening trades, six pending order types, stop limit orders, trailing stops and EAs.
Related terms
- MQL4 and MQL5
MQL4 and MQL5 (MetaQuotes Language) are the programming languages MetaQuotes developed for MetaTrader 4 and MetaTrader 5, used to write Expert Advisors, custom indicators and scripts.
- Slippage
Slippage is the difference between the price you expect when placing an order and the price at which it is actually filled. It can work against you (negative slippage) or in your favour (positive slippage).