An Expert Advisor is an MQL5 program that analyzes and executes trades without human intervention. How it works, where it runs and which red flags to check.
Behind every automated trading strategy in MetaTrader there is a file with an .ex5 extension. It may be a piece of quantitative engineering validated over years of data... or a disguised martingale that will blow up your account in the first adverse streak.
Both are called the same thing: Expert Advisor. Understanding what they are and how they work is the first filter for telling engineering apart from smoke.
What Is an Expert Advisor: The Technical Definition
An Expert Advisor (EA) is a program written in MQL5 (or MQL4 on the legacy platform) that runs inside MetaTrader and automates the complete trading cycle: price analysis, opening positions, risk management and closing. No clicks. No emotions. No sleep breaks.
How It Works Inside: The Event Loop
An EA's architecture is an event loop. The three essential events:
- OnInit(): runs when the EA is loaded onto the chart; validates parameters and prepares indicators.
- OnTick(): the heart of the system. It fires with every price change (tick). Here the algorithm evaluates its mathematical conditions and decides whether to open, modify or close positions.
- OnDeinit(): cleanup when the EA is removed.
Every decision goes through explicitly programmed rules: Stop Loss distance, lot size, trading hours, volatility filters. A well-built EA also includes kill-switches: hard daily loss limits that shut down trading automatically.
Where an EA Lives: The Terminal Must Stay On
A detail that surprises beginners: the EA runs inside your MetaTrader terminal, not on the broker's servers. If you turn off your computer, the algorithm stops trading (and worse: it leaves open positions unmanaged). That is why serious operations run on a VPS for MetaTrader 5: a cloud server running 24/7 with minimal latency to the broker.
Backtesting: Where EAs Are Validated (or Unmasked)
The great advantage of an EA over a manual trader is that its rules are verifiable. MetaTrader 5's Strategy Tester lets you simulate the strategy over years of historical data with real ticks and measure objective metrics: Profit Factor, maximum drawdown, mathematical expectancy.
But beware: a perfect backtest guarantees nothing. Overfitting (curve fitting) produces laboratory equity curves that collapse in the real market. The only definitive proof is audited real accounts, a contrast we develop in backtesting vs audited accounts.
Red Flags in a Commercial EA
- Hidden martingale or grid: it averages down losing positions while multiplying the lot. It works until the day it wipes the account.
- Results only in demo or backtest, with no verifiable real track record.
- Promises of fixed monthly returns: markets are probabilistic; nobody serious guarantees percentages.
- An absolute black box: no declared logic, no risk metrics, no published historical drawdown.
Buying an EA or Subscribing to Copy Trading?
They are two routes to the same goal (algorithmic execution), with one key operational difference:
- Your own EA: you install it, configure it, hire the VPS, monitor execution and take on the technical maintenance.
- Institutional copy trading: the algorithms run on the provider's infrastructure and the trades are replicated in your account via API. Your only configuration is the lot size. That is how the model we explain in how institutional copy trading works operates.
Neither is "better" in the abstract: the first gives total control in exchange for technical burden; the second delivers turnkey execution and leaves in your hands the decision that truly matters: risk management.
> [!TIP]
> Algorithms without the technical burden
> At AbacuQuant we don't sell .ex5 files: our 17 strategies run on institutional infrastructure and replicate into your MT5 account. Explore the Portfolio Builder, review each algorithm's audited metrics and simulate your portfolio's combined risk before connecting your account.