Expert Advisors & Forex Bots

What Is a Forex Expert Advisor (EA)?

An Expert Advisor is a program that runs inside MetaTrader and can analyse prices and manage trades automatically. This guide explains how EAs work, what types exist, and what they can and can't do.

By FX Bot Hub GuidesUpdated 3 min read

Expert Advisors in plain terms

An Expert Advisor (EA) — often called a forex robot or trading bot — is a program written in MQL4 (for MetaTrader 4) or MQL5 (for MetaTrader 5). It is attached to a chart and runs a set of rules every time a new price tick arrives: checking conditions, opening or closing trades, and adjusting stop-losses or take-profits.

An EA does exactly what its code says. It has no judgement of its own, so its results depend entirely on whether its rules suit the market conditions it meets.

EAs, indicators and scripts

MetaTrader program types
TypeWhat it doesCan it trade?
Expert AdvisorRuns continuously on a chart and reacts to every tickYes, when automated trading is allowed
IndicatorCalculates and draws values on a chartNo
ScriptRuns once to perform a single task, then stopsYes, for that one task

Some EAs are semi-automated: they manage trades you open manually (for example, a trailing stop or a break-even tool) rather than finding entries themselves.

Common EA strategy types

  • Trend following — trades in the direction of an established move, often using moving averages or breakouts.
  • Mean reversion — expects price to return towards an average after stretching away from it.
  • Scalping — many short trades targeting small moves; very sensitive to spreads, commissions and execution speed.
  • Grid — places orders at fixed intervals above and below price.
  • Martingale — increases trade size after losses to recover them. This can produce a smooth-looking equity curve until a long losing streak causes a very large loss.
  • News or time-based — trades around scheduled events or specific sessions.

What an EA can do well

  • Apply the same rules consistently, without hesitation or fatigue.
  • Monitor several symbols and timeframes at once.
  • React immediately when conditions are met, including outside your working hours.
  • Be tested on historical data before use — see How to Run a Strategy Backtest in MT5.

What an EA can't do

  • Guarantee profits. Past performance, including backtests, does not guarantee future results.
  • Adapt to market conditions its rules weren't designed for, unless it was explicitly built to.
  • Remove the costs of trading. Spreads, commissions, slippage and swaps all affect results.
  • Run when your terminal is closed or disconnected. An EA only works while MetaTrader is open and online.

What you need to run an EA

  1. 1

    The right platform

    An MT4 EA (.ex4) only runs in MetaTrader 4, and an MT5 EA (.ex5) only runs in MetaTrader 5.

  2. 2

    A broker account

    Check that your broker allows automated trading and offers the symbols the EA trades.

  3. 3

    Automated trading enabled

    Both the terminal-wide switch and the EA's own permission must be on.

  4. 4

    A computer or VPS that stays online

    For EAs that trade around the clock, many traders use a virtual private server close to their broker's servers.

Ready to set one up? Follow How to Install an Expert Advisor in MT4 or in MT5, and read How to Evaluate a Forex Trading Bot Before Buying first.

Explore Expert Advisors for MT4 and MT5 — every listing shows its documentation, compatibility details and verified-purchase reviews.

Browse Expert Advisors

Put it into practice

All tutorials

Step-by-step tutorials that build on this guide.

  • MetaTrader 5Beginner

    How to Install an Expert Advisor in MT5

    Install an Expert Advisor in MetaTrader 5: copy the .ex5 file to MQL5\Experts, attach it to a chart, allow Algo Trading and confirm it's running.

    About 10 min(estimate) 7 steps
  • MetaTrader 4Beginner

    How to Install an Expert Advisor in MT4

    Install an Expert Advisor in MetaTrader 4: copy the .ex4 to MQL4\Experts, attach it to a chart, tick Allow live trading and switch on AutoTrading.

    About 10 min(estimate) 7 steps
  • Testing & RiskIntermediate

    How to Run a Strategy Backtest in MT5

    Run an Expert Advisor backtest in the MetaTrader 5 Strategy Tester: choose the modelling mode, deposit and delays, then read the report and graph honestly.

    About 30 min(estimate) 9 steps
All guides