TradeFlux
Automated Trading

What Is an Expert Advisor in MetaTrader?

6 April 2026 5 min read

A short primer on how EAs run inside the MetaTrader platform, what they need to operate, and common misconceptions.

A trader at a multi-screen workstation beside an automated robotic trading system.
Illustrative market artwork for TradeFlux Insights.
On This Page
  1. Expert Advisors Inside MetaTrader
  2. EAs vs Indicators vs Scripts
  3. What an EA Needs to Run
  4. Settings and Inputs
  5. Keeping an EA Running Reliably
  6. Common Misconceptions
  7. Key Points to Remember

Expert Advisors Inside MetaTrader

MetaTrader (both MT4 and MT5) supports Expert Advisors as one of several program types that can run on a chart, alongside indicators and scripts. An EA is written in the platform's own programming language — MQL4 for MT4, MQL5 for MT5 — and, once attached to a chart, runs continuously in the background, evaluating its logic against live price data.

MetaTrader is one of the most widely used retail trading platforms specifically because of this EA functionality, alongside its broader third-party ecosystem of pre-built EAs, indicators and community resources. That ecosystem is one of the more practical reasons Expert Advisors are so closely associated with MetaTrader specifically, even though other platforms support their own forms of automated trading.

EAs vs Indicators vs Scripts

MetaTrader supports three main program types, and it's worth being clear on the distinction because they're sometimes confused. An indicator calculates and displays information on a chart — a moving average or an oscillator, for example — but does not place trades on its own. A script runs once, performs a defined action, and stops. An EA is the only one of the three that runs continuously and can place, modify and close trades on its own according to its programmed logic.

This distinction matters practically: an indicator can inform a manual trader's decisions without automating anything, while an EA can incorporate the same kind of indicator logic internally and act on it without a person in the loop. Understanding which category a given tool falls into avoids a common early confusion about what a piece of MetaTrader software actually does.

What an EA Needs to Run

This is a practical, often underappreciated part of running an EA — its logic can be well designed and still fail to perform as expected if the operating environment around it isn't set up correctly.

An EA needs a few things to function as intended: the platform must be running with automated trading enabled, the chart it's attached to must remain open, and the account needs sufficient margin to support any positions the EA opens. Many traders use a dedicated always-on machine or a VPS (virtual private server) for this reason — an EA can't act on a signal if the platform it's running on isn't connected.

  • A running platform — MetaTrader needs to be open with automated/algo trading permissions enabled.
  • A stable connection — the EA can only act while connected to the broker's trading server.
  • Sufficient margin — the account needs enough free margin to support the EA's position sizing.
  • Correct chart and timeframe — many EAs are built to run on a specific symbol and timeframe combination.

Settings and Inputs

Most EAs expose a set of adjustable inputs — parameters like lot size, risk percentage, or filter thresholds — that let a user tune behaviour without editing code directly. These inputs matter: running an EA with default or mismatched settings for an account's actual size and risk tolerance is a common, avoidable source of unexpected outcomes.

It's worth reading the description of each input before changing it, rather than adjusting settings by trial and error. A risk-percentage input, for example, typically controls how much of account equity is risked per trade — changing it without understanding the relationship to position sizing (covered in more depth in How Position Sizing Affects Trading Risk) can materially change an EA's risk profile without the user necessarily intending it to.

Keeping an EA Running Reliably

Because an EA can only act while the platform is running and connected, uptime is a genuine practical consideration, not a minor detail. A personal computer that's shut down overnight, loses internet connectivity, or goes to sleep will cause the EA to stop evaluating and acting on market conditions during that time, potentially missing entries or, more importantly, missing the chance to manage an open position.

This is the main reason many traders running EAs use a VPS (virtual private server) — a remote, always-on machine that keeps the platform running continuously regardless of what's happening on the trader's own computer or internet connection. A VPS doesn't change an EA's logic or risk profile; it addresses the operational reliability side of running one.

Common Misconceptions

A few misconceptions come up regularly. One is that an EA "knows" what the market is doing in any humanlike sense — it doesn't; it evaluates pre-defined conditions against incoming data. Another is that once installed, an EA requires no further attention — in practice, connectivity, margin levels and changing market conditions all warrant periodic checking. A third is that MQL4 and MQL5 code is interchangeable — the two languages are related but not fully compatible, which matters when comparing an EA built for one platform against the other.

A fourth, more subtle misconception is that an EA's presence on a chart guarantees it's actively trading. An EA can be attached to a chart but disabled, or automated trading can be switched off at the platform level, in which case the EA sits idle without necessarily making that obvious at a glance. Confirming an EA's active status is a simple check worth making a habit of, rather than assuming attachment equals activity.

Key Insight

An EA executes defined logic against live data — it doesn't interpret the market or adapt beyond what its code explicitly allows for.

Key Points to Remember

  • An EA is a program written in MQL4 (MT4) or MQL5 (MT5) that runs continuously on a chart once attached.
  • It needs a running platform, stable connection and sufficient margin to operate as intended.
  • Adjustable inputs let users tune an EA's behaviour, and mismatched settings are a common source of unexpected results.
  • An EA evaluates predefined logic against live data — it does not interpret markets beyond what its code specifies.

TradeFlux Insights

Research, education and market intelligence from TradeFlux.

TradeFlux Insights content is provided for informational and educational purposes only and should not be considered financial or investment advice. Trading involves risk, and past performance does not guarantee future results.

Continue Reading

An algorithmic trading workstation with charts, system logic and automated processing visuals.
AUTOMATED TRADING

EA Trading: A Beginner's Guide to Automated Strategies

What an Expert Advisor actually does, the conditions it responds to, and the limits of what automation can and cannot solve.

24 April 2026 8 min read
Read Article
Two side-by-side professional trading workstations illustrating a comparison between trading platforms.
EDUCATION

MT4 vs MT5: What's the Difference?

A practical comparison of the two platforms, covering the differences that actually affect day-to-day use.

27 March 2026 5 min read
Read Article
A high-tech trading workstation displaying historical charts, system data and strategy analysis.
AUTOMATED TRADING

Backtesting Explained: What It Can and Cannot Tell You

How backtesting works, what a historical test can genuinely tell you about a strategy, and the common pitfalls — like overfitting — that inflate results.

26 February 2026 8 min read
Read Article

Ready to Explore TradeFlux?

TradeFlux provides access to an automated XAUUSD strategy delivered through copy trading on RoboForex. Your funds stay in your own broker account throughout.

RISK WARNING: Trading leveraged products such as CFDs carries a high level of risk and may not be suitable for all investors. You can lose more than your initial deposit. Past performance is not a reliable indicator of future results.

View full risk disclosure