What is an Expert Advisor (EA)

By Alexander Bennett  ·  Updated May 28, 2026

How it works

An EA is a compiled MQL4 or MQL5 program attached to a chart. It runs in a loop on every new tick, checks the strategy’s entry, exit, and risk rules, and sends orders through the platform’s order interface. The EA can only act on the data and broker connection MetaTrader exposes; anything outside that environment is invisible to it.

What an EA typically codes

  • Entry logic: indicator crossovers, price-action triggers, time-based opens
  • Position sizing: fixed lot, percentage risk, or volatility-adjusted
  • Stop and target: hard stops, trailing stops, breakeven shifts
  • Exit rules: opposite signal, time stop, profit lock-in
  • Filters: session, news avoidance, volatility regime

Example

A trend-following EA on EUR/USD H1: open long when 20 EMA crosses above 50 EMA and ADX is above 25, position size 1 percent of equity, stop 2 ATR below entry, take profit at 4 ATR, trail stop after 2 ATR profit. The EA monitors the chart 24/5 and fires whenever conditions hit. No emotion, no missed signals, no late entries. Whether the strategy is profitable is a separate question entirely.

Why it matters

Automation removes the two biggest sources of trader error: hesitation and discretion. It does not add edge that is not already in the rules. A bad strategy automated is just a bad strategy executed faster. Before running any EA on live capital, test on at least 5 years of historical data across different market regimes, then forward-test on a demo account for a month. The first two weeks of live trading always surprise.

Read the full guide Read the full guide →

Get market insights, education, and platform updates from the Volity team.

Start Your Days Smarter!

High-Risk Investment Notice:  Website information does not contain and should not be construed as containing investment advice, investment recommendations, or an offer or solicitation of any transaction in financial instruments. It has not been prepared in accordance with legal requirements designed to promote the independence of investment research, and it is not subject to any prohibition on dealing ahead of the dissemination of investment research. Nothing on this site should be read or construed as constituting advice on the part of Volity Trade or any of its affiliates, directors, officers, or employees.

Please note that content is a marketing communication. Before making investment decisions, you should seek out independent financial advisors to help you understand the risks.

Services are provided by Volity Trade Ltd, registered in Saint Lucia, with the number 2024-00059. You must be at least 18 years old to use the services.

Trading forex (foreign exchange) or CFDs (contracts for difference) on margin carries a high level of risk and may not be suitable for all investors. There is a possibility that you may sustain a loss equal to or greater than your entire investment. Therefore, you should not invest or risk money that you cannot afford to lose. The products are intended for retail, professional, and eligible counterparty clients. For clients who maintain account(s) with Volity Trade Ltd., retail clients could sustain a total loss of deposited funds but are not subject to subsequent payment obligations beyond the deposited funds. Professional and eligible counterparty clients could sustain losses in excess of deposits.

Volity is a trademark of Volity Limited, registered in the Republic of Hong Kong, with the number 67964819.
Volity Invest Ltd, number HE 452984, registered at Archiepiskopou Makariou III, 41, Floor 1, 1065, Lefkosia, Cyprus is acting as a payment agent of Volity Trade Ltd.

Volity Trade Ltd. is an introductory broker for UBK Markets Ltd. It offers execution and custody services for clients introduced by Volity. UBK Markets Ltd is authorised and regulated by the Cyprus Securities and Exchange Commission (CySEC), license number 186/12 and registered at 67, Spyrou Kyprianou Avenue, Kyriakides Business Center, 2nd Floor, CY-4003 Limassol, Cyprus.

Volity Trade Ltd. does not offer services to citizens/residents of certain jurisdictions, such as the United States, and is not intended for distribution to or use by any person in any country or jurisdiction where such distribution or use would be contrary to local law or regulation.

Copyright: © 2026 Volity Trade Ltd. All Rights reserved.