Handing your trading to a robot doesn’t change what you trade. On a retail account this is usually a CFD, a contract with a provider that pays or charges you the change in a price. A CFD carries leverage, so the trade is much bigger than your deposit. This page covers how an EA works and why its test results look better than its live results. The page also explains what a VPS is for, how automated systems fail and what regulators say about robots sold online.
Key points
- An expert advisor runs on MetaTrader 4 or MetaTrader 5 and opens and closes trades according to fixed rules. It follows those rules exactly, even at moments when a person would stop.
- A backtest runs the rules over past prices. A backtest flatters a robot when the settings were tuned to that same history, and when the test fills every order at the price asked.
- A VPS is a rented remote computer. The VPS keeps your platform running day and night, fixing power cuts and dropped connections, but does nothing for the quality of the rules.
- Martingale and grid robots add to losing trades. A long run of small wins ends with a loss that takes a large part of the account in one move.
- The US regulator CFTC and Australia’s ASIC both warn about trading bots sold with promises of easy or certain profits.
- Most retail CFD accounts lose money. Automating your orders leaves the arithmetic of leverage and costs unchanged.
What is an expert advisor?
An expert advisor is a program that reads prices on a MetaTrader chart and sends orders to your provider without you clicking anything. On MetaTrader 4, it is written in MQL4 and MetaQuotes says EAs are used to automate “analytical and trading processes” (MetaTrader 4 Help). On MetaTrader 5, the language is MQL5. The two languages are different enough that an MT4 robot has to be rewritten before it runs on MT5 (trading platforms).
To launch an EA you attach it to a chart. You can double-click it in the Navigator window or drag it onto the chart. A toolbar button turns automated trading on and off across the whole platform (MetaTrader 5 Help). MetaQuotes warns of one trap here. Switching expert advisors off in the settings only stops them from trading, but the programs themselves keep running (MetaTrader 5 Help).
The rules inside can be anything that can be written down. Common ones include a moving-average crossover, a breakout past yesterday’s high and a fixed grid of orders (trading strategies). Other platforms use different names for the same idea, like cBots on cTrader and strategies on TradingView. The MetaTrader page covers the platform itself.
Automated trading terms you’ll meet
Automated trading comes with a vocabulary of its own. Sellers of robots use these words loosely.
- Expert advisor (EA)
- A trading program built for MetaTrader. “Forex EA” and “forex robot” are used interchangeably.
- Algo trading
- Short for algorithmic trading: any trading where a program decides and places the orders. An EA is the retail version of algorithmic trading.
- Strategy Tester
- MetaTrader has a part that runs an EA over past prices and shows what it would have done.
- VPS
- A virtual private server is a computer you rent in a data centre that stays on all the time.
- Martingale
- A rule that makes the trade size larger after each loss.
- Grid
- A rule that places orders at fixed price steps and usually keeps adding to a position as the price moves against it.
How does the Strategy Tester work?
The Strategy Tester replays past prices and lets the EA trade on them as if they were live. MetaQuotes says its purpose is testing and optimising expert advisors “before using them for live trading” (MetaTrader 5 Help). You choose an instrument, a date range and a method for modelling prices. The tester shows the profit, the number of trades and other statistics.
The Strategy Tester can model prices in several different ways. The fastest option relies on only the opening price of each bar. Another method reconstructs each minute from four prices. The slowest modes either simulate every tick or draw on real ticks collected by the provider (MetaTrader 5 Help). A tick means the quoted price has changed once. A robot that trades many times a day can look very different depending on which mode you pick.
Optimisation runs the same test again and again with different settings, then chooses the combination that performed best (MetaTrader 5 Help). That is where most of the trouble with robot results starts.
Why a forex robot’s backtest overstates its results
A backtest overstates a robot’s results due to how the test is built, and this happens even when nobody is lying.
- The settings were fitted to the past. If you try enough combinations, one will match the test period by chance. That is overfitting: the robot has picked up the noise in old prices. To stop this “parameters fitting”, MetaQuotes added forward testing to the tester, which runs the best settings again on data they have never seen (MetaTrader 5 Help).
- Orders fill at the price asked. With the tester’s delay setting on “No Delay”, all orders are filled at the requested price without requotes (MetaTrader 5 Help). A live order fills at the next available price instead, and that gap is slippage (how a trade works).
- The test may use the quiet spread. The spread is the gap between the buy and sell price. Your provider’s live spread widens around news and at the daily rollover. A test using a narrower spread than you’d pay flatters any robot that trades often (costs and fees).
- The seller chose what to show. What a published test shows is the best of many runs, over the period that suited the robot. Such a test often lacks the average loss, the sample size and the worst losing stretch (trading strategies).
What is a forex VPS for?
A forex VPS is a rented remote computer that keeps your trading platform switched on and connected when your own computer is off. If you run an EA on your home computer, it stops when the machine sleeps, restarts or loses its internet connection. Any trade the EA left open stays open at your provider, with nobody managing it.
MetaQuotes sells a VPS inside MetaTrader as “virtual hosting”. MetaQuotes describes it as a service for the round-the-clock operation of the platform. Robots need a constant connection to the trade server and an uninterrupted power supply, MetaQuotes says. You can also pick a server close to your provider’s to cut the delay in sending orders (MetaTrader 5 Help). The service is paid by subscription. Independent hosting companies sell the same thing.
A VPS only solves a technical problem, doesn’t improve the rules and can fail too. The VPS makes it easier to stop watching a leveraged account.
The risks of leaving a leveraged account to a program
Leaving a leveraged account to a program has risks a manual trader would spot but a robot would not.
| What happens | What the robot does | Result for you |
|---|---|---|
| The market gaps over the weekend or on news, jumping past a price without trading at it | Nothing. Its stop-loss fills at the next available price | A bigger loss than the rules planned for (risk management) |
| The spread widens | Keeps trading, or has stops triggered by the wider quote | Costs rise at the moment the test assumed they were flat |
| The platform or VPS loses its connection | Stops managing open trades until it reconnects | Trades run without the exit rules the robot was meant to apply |
| The market changes character, from sideways to trending or back | Goes on applying rules tuned to the old conditions | A long drawdown, a fall from the account’s peak |
| Losses use up your margin, the deposit held against open trades | May keep opening trades | Your provider’s margin close-out shuts positions at a loss (leverage and margin) |
Why martingale and grid robots fail suddenly
Worked arithmetic: the numbers follow from the formula given in this section.
Martingale and grid robots fail suddenly because they add to a losing position until the price turns or until the account runs out. The numbers below are made up to show the sums.
Say a martingale robot risks 10 on its first trade and doubles after every loss, so one win recovers everything and adds 10. After six losses in a row the robot has lost 10, 20, 40, 80, 160 and 320, for a total loss of 630. The seventh trade has to risk 640 to win back that 630 and gain a profit of 10. On an account of 1,000 the seventh trade can’t be placed at all, and the robot has lost 63 % of the balance chasing a profit of 10.
The record looks superb right up to that streak. Every earlier sequence ended in a small win, so the win rate is close to 100 % and the equity line climbs in a smooth slope. In a sideways market a grid robot draws the same picture, and in a strong trend it meets the same end. People do this by hand too, and it’s called averaging down. A smooth backtest from a system that adds to losers shows only that the fatal streak didn’t fall inside the test period.
Risk warning
Regulators warn about trading robots sold with promised returns
Regulators warn that trading robots and bots are a common front for fraud. According to the CFTC, the US derivatives regulator, scammers claim their algorithms deliver huge returns or 100 percent “win” rates. The CFTC also states that the technology “can’t predict the future or sudden market changes” (CFTC customer advisory). One scheme described in the advisory promised at least 10 percent a month from bot trading and collected bitcoin worth more than $1.7 billion from at least 23,000 people (CFTC customer advisory).
ASIC, the Australian regulator, lists scammers “claiming their trading bots use AI to generate passive income” among current scam types and adds that it is very unlikely these bots exist (ASIC 26-063MR). Even without fraud, real accounts do badly enough. Between 74 % and 89 % of retail CFD accounts lost money according to national regulators’ findings, as ESMA reported (ESMA press release, 27 March 2018).
What to check in a robot sold online
A robot sold online comes with claims. A few checks show how much those claims are worth. None of them makes a robot safe.
- Who is selling the product, and whether the company that opens your account appears on its regulator’s register (is trading safe). The CFTC suggests you look into the company’s or trader’s background first (CFTC customer advisory).
- Whether the record is a backtest or a live account, and whether the live account is real money or a demo.
- Whether the rules add to losing trades. A very high win rate with no losing months is the usual sign of a martingale or a grid.
- Whether the test ran a forward period and used realistic spread, commission and delays.
- What the worst drawdown was, and the effect it would have at the leverage and account size you would really use (risk management).
- Whether the seller’s income comes from the robot’s trading, or from selling copies, subscriptions and referrals to a provider. The same question applies to forex signals.
Common questions about expert advisors
Mostly, questions about expert advisors come down to whether the robots work, whether they’re allowed and what they need to run.
Do forex trading robots work?
A forex trading robot works in the sense that it places the trades its rules call for. Its rules after costs decide whether it makes money, and no published test can settle that. Backtests are usually tuned to past prices and fill orders more kindly than a live account does. According to the CFTC, trading technology can’t predict the future or sudden market changes (CFTC customer advisory).
Is automated trading legal?
Automated trading is legal where your provider offers it. Automated trading comes as standard on MetaTrader, cTrader and other retail platforms, and MetaQuotes provides open documentation on automated trading (MetaTrader 5 Help). What you can do on your account depends on your provider’s terms, and some restrict certain styles. Selling a robot with false promises of returns is different, and regulators view that as fraud.
What is the best forex EA?
No forex EA can be shown to be the best because any ranking would rest on backtests and short records that don’t predict live results. TheTraderWiki doesn’t rank or recommend robots. More useful is to ask whether the record is live, how deep the worst drawdown was and whether the robot adds to losing trades.
Do I need a VPS to run an expert advisor?
An expert advisor needs the platform to stay running and connected, and a VPS is one way to make that happen. MetaQuotes says robots need a constant connection to the trade server and uninterrupted power (MetaTrader 5 Help). A home computer that stays on does the same job less reliably. Neither a VPS nor a home computer changes how good the robot’s rules are.
Sources
The original documents this page cites, in the order they first appear.
- Expert Advisors and algorithmic trading (MetaTrader 5 Help), MetaQuotes
- Commodity Futures Trading Commission, CFTC
- Australian Securities and Investments Commission, ASIC
- Expert Advisors (MetaTrader 4 Help), MetaQuotes
- Trading Robots and Indicators (MetaTrader 5 Help), MetaQuotes
- Strategy Testing (MetaTrader 5 Help), MetaQuotes
- Strategy Optimization (MetaTrader 5 Help), MetaQuotes
- Virtual Hosting (MetaTrader 5 Help), MetaQuotes
- Customer Advisory: AI Won’t Turn Trading Bots into Money Machines, CFTC, 2024-01-25
- 26-063MR ASIC ramps-up action to protect consumers from AI-powered online investment scams, ASIC
- European Securities and Markets Authority, ESMA
- ESMA agrees to prohibit binary options and restrict CFDs to protect retail investors, ESMA, 2018-03-27
