What is a forex Expert Advisor (EA)? A plain-English guide
By Benjamin Lee · Published 2026-10-11 · Updated 2026-11-24 · 7 min read
A forex Expert Advisor (EA) is a program that runs inside MetaTrader 4 or MetaTrader 5 and opens, manages and closes trades by a fixed set of coded rules, with no clicking from you. People also call it a trading robot or bot. It applies its rules faster and more consistently than a person can, and its trades carry the same market risk as manual ones. Many EAs are out of the market most of the time: in a six-month Strategy Tester run of six EAs on the same price data, the quietest had a position open for under five of 4,440 hours, while the busiest held one for 3,725.
How an Expert Advisor works
An Expert Advisor works from a chart you attach it to: every time the price ticks, the EA reads the market, checks its rules and, if they say so, sends an order to your broker. The rules are code, written in MQL4 for MT4 or MQL5 for MT5, and might use indicators, price levels, the time of day or a mix. The EA does what the code says and nothing else, so it cannot react to anything the code does not cover.
Each EA stamps its orders with a magic number. That number is how it recognises its own positions and leaves alone the ones you opened by hand or another EA opened. Two EAs on one account stay out of each other's way only if their magic numbers differ.
What an EA does all day: it mostly waits
Five of the six EAs we measured had a position open for less than half the time. On 21 November 2026 we ran six EAs through the MetaTrader 5 Strategy Tester on the same six months of real ticks, from a 1,000 USD deposit and default inputs (My AI Gold on its prop-firm preset), and counted the hours each one had a position open out of 4,440 and the days on which it closed a trade out of 185.
Cosmos Orion closed 48 trades on 30 days and was in the market for about 5 hours in total. The Gold Space closed 405 trades but held a position for only 21 hours, because each trade lasted minutes. Pac Man BTC was in a position for 3,725 hours, 84 percent of the window. My AI Gold, SomaForex and Lycan sat in between, at 511 to 1,996 hours. The three gold EAs alone, Cosmos Orion, The Gold Space and My AI Gold, landed at 5, 21 and 511 hours, and the trade count says little about exposure: The Gold Space's 405 trades added up to 21 hours in the market, My AI Gold's 109 to 511. The full study has the method and what this means when you run more than one.
The test covers six months on one broker's demo feed, and the tester adds no slippage or delay. It describes how differently these EAs spend their time and forecasts nothing about any of them.

Use this figure on your own site
You may show this figure, with the credit link kept, on a page of your own. Copy the code below.
One trade, start to finish
Most EAs, whatever their strategy, run the same loop for each trade.
- The platform hands the EA a new tick, or a timer fires, or a bar closes.
- The EA tests its entry rule, such as an indicator cross, a break of a level or a trading-hours window.
- If the rule passes and no filter objects (spread too wide, news window, too many open trades), it works out the lot size from its risk settings.
- It sends the order, with a stop loss and take profit if the strategy uses them.
- While the trade is open it may move the stop, close part of the position, or close the lot when an exit rule fires.
EA, indicator, script, service: only one of them trades by itself
Of the four kinds of MQL program MetaTrader runs, only the Expert Advisor can trade on its own. MetaQuotes' help describes them as follows.
- Expert Advisor: attached to one chart, runs for as long as it stays there, can open, modify and close orders. Only one EA can run on a chart: attaching a second removes the first.
- Indicator: draws a calculation on the chart, such as a moving average. It cannot trade, although an EA can read its values and trade on them.
- Script: runs once when you drop it on a chart, does a single job such as closing every open trade, then ends.
- Service (MT5 only): runs in the background with no chart, usually to feed custom price data. It is not a trading strategy.
What 42 real EAs look like when you score them
We have scored 42 MetaTrader 5 EAs with one published method, all of them products we sell. By design, 15 are breakout systems, 8 are scalpers, 5 are grids and 1 follows trends. The other 13 fit no single family, often because the seller calls them AI or neural systems without saying how they trade.
Design said a lot about risk. Scalpers averaged 48.8 out of 100 and breakout EAs 47.9. Grids averaged 42.1, and all 5 carry a High risk label. The 13 we could not classify averaged 34.8, and 11 of them are rated High risk. Treat a seller who cannot say how the EA trades as a warning sign.
Proof was the weakest part almost everywhere. 14 of the 42 scored under 4 out of 10 for verified evidence, none reached 7, and no EA reached the Credible band of 70. The best was The Gold Space at 64.8. These are desk-research scores of public evidence, not hands-on tests, and the verdict data lists every one.
- Breakout EAs enter when price leaves a range or a level, often a few times a day. They lose in quiet, choppy weeks and lean on a few larger winners.
- Scalpers take many small trades, so spread, commission and execution speed decide much of the result, and the choice of broker matters more than the strategy label.
- Grid EAs open more positions as price moves against them and close the basket together. The equity curve looks smooth until one long one-way move.
- Martingale EAs raise the lot size after a loss, so a short losing streak can outgrow the account.
- Trend-following EAs ride moves already under way and accept long strings of small losses between them.
What arrives when you buy an EA
Every EA ships as a compiled .ex5 file. MetaTrader can run it, but you cannot read or change its rules. What else comes with it varies. On 20 November 2026 our catalogue listed 69 EAs: 18 included a setfile with the developer's recommended inputs, 24 a PDF manual, and 28 offered the MQ5 source code as a separate edition. For most EAs, then, you start from the default inputs, which is why reading the input list and testing on demo matter.
The source code is the .mq5 file the .ex5 is compiled from. You open it in MetaEditor, read how the EA enters, sizes and protects each trade, and recompile it with F7. Our source-code page lists which EAs sell it and flags the ones where the source is older than the EA.
What an EA cannot do
An EA cannot predict prices, and a strategy that worked in the past can stop working when the market changes. It knows nothing about news unless it was coded to. It also works only while the platform is running, connected and allowed to trade: switching the permission off in the settings stops it sending orders but does not unload it, and closing the terminal stops it altogether, with open positions still exposed.
Its strengths are narrower: it follows its rules every time without hesitation, it can watch the market around the clock while your computer or VPS stays on, and it applies stop and sizing rules the same way on every trade. Trading leveraged products carries a high risk of loss, so never trade money you cannot afford to lose.
Getting started without risking real money
Start on a demo account and let the EA run through different market conditions before any real money is involved. The install guide covers the folder and the two trading permissions, and the complete MT5 guide shows the order to do everything in.
- You need an MT4 or MT5 account with a broker that allows automated trading, the EA file (.ex4 or .ex5), its setfile if it has one, and a computer or VPS that stays online.
- Read the manual and the input list before you attach it, and check the Experts tab for errors in the first minutes.
- Run it on demo for several weeks and keep a log, as described in the first 30 days guide.
- If you go live, use a lot size you could lose without distress, and scale up only after live results match what you saw on demo.
Frequently asked questions
Is an Expert Advisor the same as a trading bot?
Yes. EA, trading robot and trading bot all describe an automated strategy that runs inside MetaTrader. Expert Advisor is the official MetaTrader name and covers MT4 and MT5 programs. What differs is the strategy inside, which decides how risky it is.
Do I need coding skills to use an EA?
No. You install the file, load the recommended settings and attach it to a chart. Coding in MQL4 or MQL5 is only needed to write or change one. You do need to understand its inputs and risk settings and how to tell that it is running.
Can an EA guarantee profit?
No. Results depend on the strategy, the market and the broker, and losses are possible. An EA automates rules, and rules can lose money. Treat any seller who promises fixed or guaranteed returns as a red flag.
Does a forex EA work while my computer is off?
No. An EA runs only while its MetaTrader terminal is open, connected and allowed to trade. If the computer sleeps or loses its connection, the EA stops managing trades and open positions stay exposed. Many traders use a VPS, a remote computer that stays online.
Is it legal to use a forex EA?
Brokers that offer MetaTrader generally allow automated trading, but rules vary by broker, account type and country. Check your broker's terms on EAs, scalping and high-frequency trading, and the financial rules where you live. This is general information, not legal advice.
What is the difference between an EA and an indicator?
An indicator only draws information on a chart, such as a moving average, and cannot trade. An EA can also send orders, so it can open, modify and close trades by itself. Many EAs use indicators internally to decide when to trade.
Sources and further reading
- MetaTrader 5 Help: Algorithmic Trading, Trading RobotsMetaQuotes' overview of Expert Advisors, strategy testing and optimisation in the platform.
- MetaTrader 5 Help: Expert Advisors and Custom IndicatorsHow Expert Advisors and custom indicators work in the terminal.
- MetaTrader 5 Help: How to Create an Expert Advisor or an IndicatorWhich folder each file type goes in, why a .mq5 source file needs compiling, and what does and does not stop a running robot.
Trading foreign exchange, gold and CFDs carries a high level of risk and may not be suitable for all investors. Past performance, backtests and live results do not guarantee future returns. This guide is general education, not financial advice.
More on MT5 Expert Advisors: the basics
More guides
- How to choose a forex broker for an Expert Advisor
- Spread, slippage and swap: the hidden costs of EA trading
- How to forward-test an Expert Advisor on a demo account
- Martingale and grid Expert Advisors: how they work and what can go wrong
- Lifetime vs subscription vs rental: which Expert Advisor licence costs less?
- MT5 Expert Advisors: the complete guide
- How to install an Expert Advisor (EA) on MetaTrader 5