Skip to content
Menu

Expert Advisor

By Chad Smith, Director of Research & Analysis · Updated

On this page
  1. Worked example
  2. Why it matters to a trader
  3. Common confusions
  4. Related terms

An expert advisor (EA) is a program that runs inside MetaTrader 4 or MetaTrader 5 and can analyze the market and open, manage or close trades automatically by set rules.

Worked example

Example: a trader codes a simple EA with these rules:

  1. If the 20-period moving average crosses above the 50-period average on the H1 chart, buy.
  2. Size each trade so the stop-loss, 30 pips away, risks 1% of equity.
  3. Close the trade at a 60-pip take-profit or the stop.
  4. Do not trade within 30 minutes of high-impact news.

The trader backtests the EA over several years, then forward tests it on a demo account. Once satisfied, they run it on a VPS so it keeps working when their own computer is off.

Why it matters to a trader

EAs remove emotion and fatigue from following rules. They can watch many markets at once, react instantly and apply position sizing exactly the same way every time. They also make testing ideas much faster.

The risks are real:

  • An EA is only as good as its rules. Many commercial EAs are overfitted to past data.
  • Technical problems, such as a lost connection or a coding bug, can cause unexpected trades.
  • Strategies such as grid or martingale systems can look stable for a long time and then lose heavily.

Common confusions

  • EA versus indicator. An indicator only shows information. An EA can place trades.
  • EA versus signals. Signals and copy trading copy another trader's actions. An EA follows its own coded rules.
  • cBots. On cTrader, the equivalent is called a cBot.

Where to practice this

Put this into practice on a demo account first, with no money at risk.

Frequently asked questions

Do expert advisors make money automatically?

No. An EA follows rules. If the rules have no edge, or market conditions change, the EA will lose money just as a manual trader would.

Do I need to keep my computer on for an EA?

Yes, unless you run it on a VPS. The EA only works while the platform is open and connected.

Can I write my own EA?

Yes. EAs are written in MQL4 for MT4 and MQL5 for MT5, and many traders also hire developers to code their rules.

How can I judge an EA I want to buy?

Look for a long, verified live track record, clear rules and realistic results. Very smooth backtests alone are a warning sign.