Beginner Guide · 2026

What Is a MetaTrader 5 Expert Advisor?

An Expert Advisor (EA) is a program that runs inside MetaTrader 5 and can analyse the market, open trades, and manage positions automatically — all without you clicking a button. No coding knowledge required to use one.

12 min readUpdated March 2026Pro-Scalper Team

What you will learn

What an Expert Advisor is (and is not)
How EAs analyse and trade automatically
The three types of MT5 Expert Advisors
What backtesting is and why it matters
Common myths that trip up beginners
How to choose and evaluate an EA safely

The Simple Definition

Definition

An Expert Advisor is a script written in MQL5 that runs inside MetaTrader 5. It has full access to price data, indicators, and order functions — meaning it can open, modify, and close trades on your account automatically.

Think of it as a trading rule-set that never sleeps, never hesitates, and never deviates from its instructions. The EA runs on every new price update (called a tick) and checks whether conditions are met to act.

The term is specific to MetaTrader. On other platforms the same concept goes by different names — trading robot, algorithmic strategy, or just "bot". On MT5, it is always called an Expert Advisor, and the file extension is .ex5.

You do not need to write code to use one. Pre-built EAs are distributed as compiled .ex5 files. You copy the file to your MT5 data folder, drag it onto a chart, set the parameters, and it runs. The source code stays with the developer.

How an EA Actually Works

Every time the price updates — which on XAUUSD can be thousands of times per second — MT5 calls the EA. This is the core loop that drives all automated trading.

01

Tick arrives

A new price update hits the chart — could be thousands per second on XAUUSD.

02

EA wakes up

MT5 calls the EA's OnTick() function. The code runs.

03

Reads market

Checks price, indicators, open positions, session, spread, account balance.

04

Evaluates rules

Are entry conditions met? Should any open trade be modified or closed?

05

Sends order

If conditions are met, sends a buy or sell order directly to the broker.

This loop happens in milliseconds — far faster than any human could react. That speed advantage is particularly valuable in scalping strategies on volatile instruments like XAUUSD, where entry timing matters significantly.

The Three Types of Expert Advisors

Not all EAs trade fully automatically. Understanding the three types helps you choose one that matches how involved you want to be.

Fully Automated EA

Enters, manages, and closes trades without any user action. You configure the settings once and the EA handles everything — entries, exits, stop losses, take profits, trailing stops.

Semi-Automated EA

You decide when and in which direction to trade. The EA then takes over: automatically setting stop loss, take profit, breakeven, and trailing stop — removing the emotional management.

Utility / Tool EA

Does not trade on its own. Instead it adds tools to your chart: risk calculators, on-screen dashboards, trade journals, news filters, or session timers. Often used alongside a manual or automated strategy.

Examples:On-chart dashboardsRisk calculatorsSession indicators

The Six Components Inside Every EA

When evaluating an EA, these are the building blocks you are assessing. A well-built EA handles all six.

Entry Logic

The ruleset that determines when to open a trade. Could be an indicator signal (ADX, RSI, ATR), a price pattern (breakout, range), a time condition, or any combination.

Exit Logic

When and how to close a trade. Includes fixed take profit, trailing stop, dynamic exit conditions, time-based exits, or breakeven moves.

Risk Management

Controls position sizing (fixed lot, % of balance, or ATR-scaled), maximum trades per day, maximum drawdown limits, and per-trade stop loss distance.

Filters

Additional conditions that gate entries. Common examples: spread filter (skips trades when spread is too wide), session filter (only trades certain hours), trend filter (only trades with momentum).

Order Management

Handles the lifecycle of open trades: moving stop loss to breakeven once in profit, applying trailing stops, partial closes, and handling margin calls or broker disconnects.

Dashboard / Alerts

Optional on-chart panel showing live statistics: current P&L, open trades, session status, drawdown, daily gain. Some EAs also push Telegram or push notifications.

What Is Backtesting?

Backtesting runs your EA against historical price data to see how it would have performed in the past. MT5 includes a built-in Strategy Tester for this. You set a date range, tick quality, and starting balance — the tester simulates every price tick and records every trade the EA would have made.

What backtest tells you

  • Whether the logic works on historical data
  • Typical win rate, drawdown, and profit factor
  • How the EA behaves in different market conditions

What backtest cannot tell you

  • How it will perform on future data
  • How slippage and spread will affect live results
  • Whether the strategy is over-optimised (curve-fitted)

A good backtest uses real tick data (not modelled), includes realistic spreads, and covers a minimum of two years including both trending and ranging market conditions. Always treat a backtest as a necessary filter — not a guarantee.

4 Common Myths About Expert Advisors

Misconceptions about EAs are everywhere. Here is what new traders often get wrong.

Myth

"An EA will make money automatically with zero effort"

Reality

An EA executes a strategy automatically — but the strategy still needs to be sound. Poor settings, a bad broker, or wrong market conditions can turn any EA into a losing one. Setup and periodic monitoring matter.

Myth

"A great backtest guarantees future profits"

Reality

Backtests are a useful filter, not a crystal ball. Markets change. An EA backtested on 2022 data may behave differently in 2026. Look for strategies with clear logic, not just the best-looking equity curve.

Myth

"Any MT5 broker will do"

Reality

Spread and execution quality directly affect scalping EA results. A broker with 1.5-pip raw spreads vs a 0.10-pip ECN broker can mean hundreds of dollars difference per month on an active scalping EA.

Myth

"Once set up, you never need to touch it again"

Reality

EAs need periodic review. Market regimes shift. A strategy that worked in a trending market may overperform in a ranging one. Monitor monthly, check drawdown, and update settings if needed.

How to Evaluate an EA Before You Buy

Not all EAs are built honestly or competently. Here is a checklist to apply before committing to any automated strategy.

The strategy is explained — not just the results

You should understand how and why it enters trades. "Proprietary AI system" with no further explanation is a red flag.

Backtested on real tick data, not modelled ticks

MT5 Strategy Tester allows different data quality levels. Real ticks produce more accurate results than modelled data.

At least 2 years of backtest history

Short backtests are easy to over-optimise. Two years must include both trending and ranging market conditions.

Drawdown is disclosed and acceptable

Maximum drawdown under 20–30% is generally manageable. Very low drawdown on a backtest with very high profit is often a sign of curve-fitting.

Live results exist alongside the backtest

A developer running their EA on a live or demo verified account is a positive signal. Backtests alone are insufficient.

Actively maintained with clear support

Markets change. An EA with an active developer who updates it and answers questions is far safer than an abandoned product.

Avoid: guaranteed profit claims

No EA can guarantee profits. Any sales page making this claim is violating both common sense and most financial advertising rules.

Avoid: Martingale without disclosure

Martingale (doubling lot size after losses) can produce impressive short-term results but carries unlimited drawdown risk. It must be disclosed.

Getting Started: What You Need

The barrier to running your first EA is lower than most traders expect.

  1. 1

    An MT5 account with an ECN broker

    Open an account with a broker that supports MT5 and has tight spreads on your target instrument (see our broker guide for recommendations). Download and install MetaTrader 5.

  2. 2

    The EA file (.ex5)

    Obtain the EA from a trusted developer. Copy the .ex5 file to your MT5 data folder: File → Open Data Folder → MQL5 → Experts. Restart MT5.

  3. 3

    Attach to a chart and configure

    Find the EA in the MT5 Navigator panel. Drag it onto the correct chart and timeframe. Review and configure the input parameters — lot size, stop loss, filters. Click OK.

  4. 4

    Enable automated trading

    Make sure the "Auto Trading" button in the MT5 toolbar is green. The EA will now run on every tick while MT5 is open.

  5. 5

    (Recommended) Run on a VPS

    For 24/5 operation, move MT5 to a Windows VPS server. This keeps the EA running even when your computer is off, and reduces latency to the broker's servers.

Frequently Asked Questions

Do I need to know how to code to use an MT5 Expert Advisor?

No. You only need to code if you want to build your own EA from scratch. Using a pre-built EA requires no coding — you simply attach the .ex5 file to a chart in MetaTrader 5 and configure the settings.

Can an Expert Advisor trade while my computer is off?

Not if you run it on your personal computer — the EA stops when MT5 closes. To run an EA 24/5 you need a Virtual Private Server (VPS) that keeps MT5 running continuously regardless of your local machine.

Is automated trading legal?

Yes. Expert Advisors are fully legal and are used by retail traders worldwide. MetaTrader 5 is designed with EA automation as a core feature. Always check your broker terms, but no regulated broker prohibits EA use outright.

Can I lose money with an Expert Advisor?

Yes. An EA is not a guarantee of profit. It executes a strategy automatically — if the strategy has flaws, or market conditions change, losses can occur. Proper risk settings, a quality broker, and an understanding of the strategy are essential.

What is the difference between an EA and a trading signal?

A trading signal tells you when to trade — you still manually place the order. An Expert Advisor acts on signals automatically, opening and managing trades without your input. EAs are faster and eliminate the delay of manual execution.

How do I install an Expert Advisor on MetaTrader 5?

Copy the .ex5 file into your MT5 data folder under MQL5/Experts. Restart MT5, find the EA in the Navigator panel, and drag it onto the chart. Enable automated trading, configure the inputs, and click OK. The EA will begin running on that chart.

Ready to run your first EA?

Try a Purpose-Built Gold EA

Pro-Scalper EAs are built specifically for XAUUSD on MT5. Each one includes full documentation, clear strategy logic, and active developer support.