Trading robots

What Is a Trading Robot (Expert Advisor) and How Does It Work

A trading robot is not a magic profit button. It is a program that follows clear rules without getting tired. Here is how it works, where it helps and where people go wrong.

Boris Kuljaj · 8 min read

What Is a Trading Robot (Expert Advisor) and How Does It Work
Contents
  1. What is a Forex trading robot (Expert Advisor)?
  2. How a robot works in practice
  3. Pros and cons of automated trading
  4. Types of robots you will come across
  5. How to judge a robot before you run it
  6. What you need for a robot to run
  7. What a robot cannot do for you
  8. In short: how to get started

When people first hear about a Forex trading robot, most of them picture a program that makes money while they sleep. Part of that is true: a robot really can trade while you sleep. Whether it makes money depends on the rules it follows, on the market and on the risk you allow it to take.

I traded manually for years before I turned my best ideas into robots. The biggest lesson from that process: a robot does not invent a strategy. It simply executes, consistently, whatever you tell it to do.

In this article you will learn what an Expert Advisor is, how it actually works in MetaTrader 5, the real pros and cons of automated trading, and how to judge a robot before you let it trade real money.

What is a Forex trading robot (Expert Advisor)?

A trading robot, known in the MetaTrader world as an Expert Advisor (EA), is a program that runs inside the platform and opens, adjusts and closes positions on its own, based on rules set in advance. In MetaTrader 5, robots are written in the MQL5 language and you receive a ready-made file with the .ex5 extension.

A robot does not "think" and does not predict the future. On every new tick (every price change) it checks its conditions: has price broken a level, is it above or below a moving average, is it the right time of day. When all conditions are met, it sends an order to the broker.

The key point: a robot is only as good as the logic it executes. A bad strategy inside a robot is still a bad strategy, just faster.

How a robot works in practice

Every serious robot has a few building blocks:

  • Entry rules: when it opens a position and in which direction.
  • Exit rules: where the stop loss (the point where you accept a loss) and the take profit (the target) are.
  • Risk management: how much of the account it risks per trade and how it calculates the lot size.
  • Filters: time of day, trend, news, maximum number of trades per day.

An example from our own work: Gold Trimmer v1.0 measures the gold range between 23:00 and 01:00 GMT every night. When price later breaks out of that range, it enters in the direction of the breakout. The stop loss is twice the range, the take profit 1.5 times the range, there is at most one trade a day, risk is 0.5% per trade and there is no martingale (no doubling the lot after a loss).

Rules like these are clear and measurable. That is why they can be tested on historical data, and why a robot can follow them without emotion.

Pros and cons of automated trading

RobotManual trading
Emotionsno fear, no greedfear, FOMO, revenge
Disciplinesame rule every timedepends on the day and your mood
Timeruns 24/5 (with a VPS)only when you are at the screen
Adaptingonly what was programmedyou can judge a new situation
News and shocksdoes not understand contextyou can stay out
Testingbacktest over years of dataslow and difficult

The biggest advantage of a robot is consistency. Most manual traders don't lose because of a bad strategy; they lose because they don't follow it. They move the stop loss, skip trades after a loss, double the lot. A robot does none of that.

The biggest weakness is rigidity. A robot doesn't know the market has changed character, that today is a holiday or that a central bank just surprised everyone. That is why you still need to keep an eye on it.

Types of robots you will come across

Not all robots are alike. Roughly, they fall into these groups:

  • Breakout robots: wait for price to leave a range and trade in the direction of the breakout.
  • Trend robots: follow the trend with moving averages and enter on pullbacks.
  • Scalpers: short trades, small targets, often during specific hours.
  • Grid and martingale: add positions or increase the lot when price moves against them. They can look perfect for a long time, until one strong move wipes out the account.

Our London Scalper v1.0 trades gold and EURUSD around the London open, with an EMA-200 trend filter. Astro Hero v1.0 works on Forex pairs on the H4 chart: it follows the trend with EMA 8/21/89 and enters on the first pullback to the EMA89. It is more aggressive and not meant for prop firm challenges.

Learn and trade with THE ONE FX

Everything you need after this article, in one place.

How to judge a robot before you run it

Before you let any robot trade real money, go through this list:

  1. Do you understand the logic? When it enters, when it exits, how much it risks per trade.
  2. Does every trade have a stop loss? A robot without a stop loss is a time bomb.
  3. What is the maximum drawdown in the backtest? That is the biggest drop of the account from a peak. I explain how to read the report in how to read a backtest report.
  4. How many years was it tested? A few months is not enough. You want to see different market phases.
  5. Does it use martingale or a grid? If so, know exactly what you are risking.
  6. What does it do around news? More on that in trading robots and economic news.
  7. Test it on a demo account first, or with the smallest possible risk.

Our backtests, for example, show +11.7% over 5 years for Gold Trimmer with a maximum drawdown of 2.9%. London Scalper shows +14.7% on gold with a 3.9% drawdown, and +8.8% on EURUSD with a 3.2% drawdown. Those are modest, realistic numbers, not promises.

To see what transparent records of one account look like, visit the results page: a live 200K real account on Myfxbook and a journal since 2023, in percent only.

What you need for a robot to run

Technically, not much:

  • MetaTrader 5 and an account with a broker.
  • The robot file (.ex5) that you add to the platform. The whole process is in how to install an EA on MT5.
  • Algo Trading switched on in the platform.
  • A computer that is always on, or a VPS. If you shut down your computer, the robot stops. That is why most people use a VPS, which I cover in VPS for trading robots.

Our robots are free with an XM, Vantage or PU Prime account opened under my partner code. The minimum balance to run them is $100, and the recommended balance is $1,000, because on a smaller account even the smallest lot can mean a bigger percentage risk. Each robot comes with a PDF guide for installation and VPS setup. You will find all details and the backtest panels on the robots page.

What a robot cannot do for you

A robot cannot give you patience. If you switch it off after three losses in a row and back on after three wins, you have brought your emotions straight back into the system.

A robot cannot replace risk management. If you raise its risk from 0.5% to 5% because "it's going well", you change the whole profile of the strategy, and the drawdown from the backtest no longer applies.

And a robot does not guarantee profit. Automation solves the discipline problem, but it doesn't change the fact that markets sometimes move against any strategy, for weeks at a time.

In short: how to get started

If you are thinking about using a robot, go in this order: understand the logic, look at the backtest and the drawdown, run it on a demo account or with minimal risk, and give it enough time and enough trades before you judge it. Treat the robot like an employee who does exactly what you told it to do, nothing more and nothing less.

Frequently asked questions

Do Forex trading robots actually make money?

Some robots show positive results over long periods, many don't. The outcome depends on the strategy, the market and the risk. No robot guarantees profit, and even a good one goes through losing periods.

What is an Expert Advisor in MetaTrader 5?

An Expert Advisor (EA) is a program written in MQL5 that runs inside MetaTrader 5 and opens and closes positions on its own, based on set rules. It is installed as an .ex5 file in the MQL5 > Experts folder.

Does a trading robot need to run 24 hours a day?

A robot only works while MetaTrader 5 is open and connected to the internet. That is why most traders use a VPS, a server that is always on and close to the broker's servers.

How much money do I need for a trading robot?

It depends on the robot and on the smallest lot size. For our robots the minimum is $100 and the recommendation is $1,000, because on a smaller account even a 0.01 lot can be a bigger percentage risk than planned.

Are martingale robots dangerous?

Martingale increases the lot size after a loss. The equity curve can look smooth for a long time, but one long move in the same direction can wipe out a large part of the account. If you use one, you need to know exactly what the worst case looks like.

Risk warning: trading Forex, gold and CFDs carries a high risk of losing capital and is not suitable for everyone. This article is educational and is not investment advice or a recommendation to buy or sell. Examples are illustrative, and past results do not guarantee future results. Some links are affiliate links: more information.

Read next

All articles