What an Expert Advisor is

By Otto Research 3 min read Article 19 of 95

An Expert Advisor, or EA, is a program written in the MQL5 language that runs inside MetaTrader 5, attached to a chart, and trades the account automatically. It reads prices as they arrive, applies a set of rules, and places, manages and closes orders without a person clicking anything. The word "advisor" is historical; an EA does not advise, it acts.

What an EA does

Everything a trader does at the screen, an EA can do without one. It watches one or many markets continuously, decides when the conditions for a trade are met, works out the position size, places the order with its stop loss and take profit, and manages the position until it closes. It does this at any hour the market is open, as many times as its rules require, and it does it the same way every time.

What an EA does not do

An EA does not know anything its rules do not contain. It does not read the news, understand a central bank, or notice that the world has changed. It applies the same logic on the day of a crash as on any other day, which is a strength when the logic is sound and a serious weakness when it is not. An EA does not remove risk from trading. It removes discretion, hesitation and fatigue, and it leaves the risk exactly where the rules put it.

Kinds of EA

Single-strategy EAs apply one set of rules to one or a few markets. Multi-strategy EAs run several independent sets of rules, often on different markets and timeframes, in one program. Grid and martingale EAs open additional positions as the market moves against them, and they are covered on their own page because their results look nothing like they are. Signal copiers and trade managers are also technically EAs but do not generate trades themselves.

How an EA is sold and installed

An EA is distributed as a compiled .ex5 file, either through the MQL5 Market built into the platform, which handles licensing and limits the number of installations, or directly from the developer. Its settings are exposed as inputs, which the trader can change, and the more of its logic a developer leaves in the inputs, the more of it a buyer can alter or break. The strategy itself is inside the compiled file and cannot be read.

Worked example

A trader attaches an EA to a four-hour chart of the FTSE 100 on Sunday evening and does not look at it again until Friday. During the week the EA opened two positions at the open of a four-hour bar, each with a stop and a target sent to the broker, closed one at its target on Tuesday, and closed the other at its stop on Thursday. The trader's part was to install it, set the risk level, and leave it alone. That last part is the hardest.

What a well-built EA looks like

Every position carries a hard stop loss held at the broker from the moment it opens. Position size is calculated from the stop distance and a stated risk, not typed in as a fixed lot. The rules for entry and exit are described in plain language, even if the exact parameters are not. There is no grid, no martingale, and no adding to losing positions. There is a live, independently verified record, running for long enough to include losing periods, and it is presented as the evidence, with any backtest clearly labelled as a backtest. And the EA logs what it does, so that its behaviour can be checked against its description.

An EA without those things can still be sold. It should not be bought.

From theory to live

See it put to work.

The concepts on these pages are what Otto is built on. Watch it trade them live, on real accounts.