An Expert Advisor (EA) is a program that runs inside MetaTrader and trades automatically: it reads prices and indicators, decides according to rules written in advance, opens and closes positions, and manages their stop loss and take profit without you having to click. In MetaTrader 5 it’s written in MQL5 and loaded as an .ex5 file.
If you’ve heard about “trading robots” and want to understand them without the jargon, this guide explains the roles an Expert Advisor plays in MetaTrader 5, how to use one, what it can’t do and, above all, which risks you should know about before you use one.
What is an Expert Advisor (EA)?
The name is MetaTrader’s own: what most people call a “trading robot” or a “forex robot”, MetaTrader calls an Expert Advisor, or EA for short. It trades the financial markets automatically, following a set of rules defined in advance. Instead of you deciding by hand when to buy or sell, the EA does it for you according to its strategy.
Think of it as a tireless assistant: it watches the market around the clock, spots the situations that meet its rules and places trades without you having to sit in front of the screen. It doesn’t get tired, it doesn’t hesitate and, above all, it doesn’t make impulsive or emotional decisions, one of the biggest mistakes people make when they trade manually.
Expert Advisors are written in a programming language called MQL5 (MetaTrader 5’s native language). The source code is a .mq5 file, which MetaEditor compiles into the .ex5 file the platform runs; commercial EAs are usually delivered as the .ex5 file only, ready to load onto the platform.
The roles of an Expert Advisor in MetaTrader 5
MetaTrader 5 (MT5) is one of the most widely used trading platforms in the world. It’s free, and many brokers offer it. It’s where the Expert Advisor “lives”: you attach it to a chart, and from then on it reacts to every new price that arrives for that symbol. Within that cycle, an EA can take on six roles:
- Market analysis: it reads prices and calculates technical indicators in real time (moving averages, volatility, price levels and so on), on its own chart or on other symbols and timeframes.
- Decision-making: it compares what it sees with the conditions of its strategy. For example: “if these signals line up at the same time, open a buy trade.”
- Order execution: it sends the orders itself, at market or as pending orders (buy stop, sell limit and the like), with the volume, the stop loss and the take profit already set.
- Trade management: while a trade is open, and depending on how it’s programmed, it can move the stop to the entry price (break-even), trail it behind the price (trailing stop), close part of the position or close everything at a given time.
- Risk control: it can calculate the lot size from the balance and the stop distance, limit how many trades it opens and stop trading after a loss limit, if its rules say so.
- Alerts and testing: it can send on-screen alerts, emails or push notifications to the MetaTrader mobile app, and the same EA can be run on historical data in the Strategy Tester to see how its rules would have behaved.
Not every EA does all six: a simple one may only open and close trades, while a complete one covers the whole cycle. All of this happens on its own, again and again, as long as the platform is running and connected. That’s why many users run MetaTrader on a VPS (an always-on server in the cloud), so the EA doesn’t depend on their own computer being switched on.
Expert Advisor vs indicator vs script
MetaTrader 5 runs several kinds of programs, and they’re easy to confuse:
| Program | What it does | Trades? |
|---|---|---|
| Expert Advisor | Stays on a chart and reacts to every new price | Yes, on its own |
| Indicator | Calculates and draws on the chart (lines, levels, signals) | No |
| Script | Runs once, does one task and unloads | Only that one action |
Each chart can hold one Expert Advisor at a time; to run several, you open several charts. And an EA built for MetaTrader 4 (MQL4, .ex4 files) doesn’t run in MetaTrader 5: the differences are in MetaTrader 4 vs MetaTrader 5.
The benefits of automated trading
Automating your trading with a well-designed EA brings clear advantages over manual trading:
- No emotions: an EA feels neither fear nor greed. It follows its strategy with discipline, even when the market gets tense.
- Available 24/5: it doesn’t need to sleep. It watches the market continuously and doesn’t miss opportunities because nobody was at the screen.
- Speed and precision: it executes in milliseconds what would take a person precious seconds.
- Consistency: it applies exactly the same rules every time, without “skipping” them one day on a hunch.
Expert Advisor risks and limits you should know about
This is where we need to be honest, because the internet is full of exaggerated promises. An Expert Advisor is not free money, and it isn’t a machine that wins without risk. Here’s what you need to be clear about:
- No strategy wins every time. There will be losing trades and bad streaks. A good EA manages risk; it doesn’t eliminate it.
- Leveraged trading can make you lose capital, even everything you’ve invested. Only trade with money you can afford to risk.
- Be wary of profit promises. Phrases like “double your money” or “no risk” are red flags. Past results don’t guarantee future results.
- Overfitting is the big enemy. A robot can look perfect on historical data and fail in the live market if it has been fitted too closely to the past. That’s why robustness testing matters.
An Expert Advisor is a software tool. It does not constitute financial advice. You trade in your own account, and the responsibility is yours. The quality of an EA is measured by how it manages risk and how solid its testing is, not by how much it promises to make.
How to use an Expert Advisor in MT5, step by step
If you want to try automated trading, this is the usual path:
- Open an account with a broker that offers MetaTrader 5 and the asset you’re interested in (for example, gold / XAUUSD).
- Install MetaTrader 5 and log in with your account.
- Get an Expert Advisor you trust, with transparent testing and good risk management.
- Copy it into MetaTrader: File → Open Data Folder →
MQL5/Experts, plus any custom indicators it needs inMQL5/Indicators. - Attach it to a chart of the right symbol and timeframe, review its inputs and turn on the Algo Trading button so it can trade.
- Try it on a demo account first, and only then on a live one (how to test a trading robot before you risk your money).
- Consider a VPS so it can trade continuously without depending on your computer.
The detailed version, including the folder path on a Mac and the most common errors, is in our article How to install an Expert Advisor in MetaTrader 5, step by step. And if it’s installed but not opening trades, go through why an Expert Advisor is not trading in MT5.
Frequently asked questions
Is an Expert Advisor the same as a trading robot?
Yes. “Expert Advisor” is MetaTrader’s name for what’s commonly called a trading robot, forex robot or trading bot: a program that trades by itself following rules written in advance.
Does an Expert Advisor keep trading if I close MetaTrader 5?
No. An EA only works while MetaTrader is open and connected. Orders already registered with the broker, such as a stop loss or a take profit, stay in place, but nothing new happens until the platform is running again. A VPS solves this.
Can I run several Expert Advisors in MT5 at the same time?
Yes, one per chart: open a chart for each EA. Make sure they don’t interfere with each other’s trades and that your account’s margin can handle all of them together.
Do MetaTrader 4 Expert Advisors work in MetaTrader 5?
No. MT4 EAs are written in MQL4 and compiled as .ex4 files; MetaTrader 5 needs an EA written in MQL5 (.ex5), so the developer has to rewrite it for MT5.
Do brokers allow Expert Advisors?
Most brokers that offer MetaTrader 5 allow them, but some restrict certain techniques, such as very high-frequency scalping, and prop firms set their own rules. Check the terms before you start (see how to choose a broker for an Expert Advisor).
Can an Expert Advisor guarantee profits?
No. An EA applies its rules consistently, but no set of rules wins every time, and leveraged trading can lose you the capital you deposit. Judge an EA by its risk and the quality of its testing, not by its promises.
AUREUM, an Expert Advisor specialized in gold
An algorithm for MetaTrader 5 focused on XAU/USD: its trades carry a stop loss and a take profit registered with the broker, and its two strategies went through Monte Carlo and out-of-sample checks. No magic promises: the numbers, unfiltered.
Discover AUREUM →