Logo

How Automated Trading and Expert Advisors Really Work

  • Strategy & Analysis

15 λεπτά ανάγνωσης

Search for trading bots and most of what comes back is for sale. That shapes the available information more than any technical consideration does, because the people with the strongest incentive to explain automation are the people selling it, and the explanation they give is the one that closes the sale.

This page takes the opposite starting point. Automation is a real capability with a narrow and specific benefit, and understanding where that benefit stops is more useful than any description of what a system can do when everything goes to plan.

The short version: automation changes who executes your rules. It does not change whether the rules work. Those are separate problems, and the second one is the hard one.

What an automated strategy actually is

An automated strategy is a set of rules written precisely enough that a machine can follow them without asking you anything.

That requirement is more demanding than it sounds, and it is where most of the real work happens. A discretionary trader can hold a rule like "enter when the level holds and conditions look constructive" because a human fills in the gaps. A machine cannot. Every term has to resolve to a number or a comparison: which level, measured how, held for how long, confirmed by what, with what position size, and what happens if two conditions conflict.

Writing rules that admit no judgement forces you to discover how much of your method was judgement. Many people who set out to automate a strategy find there was no strategy, only a collection of instincts that worked differently each time they were applied. Discovering that is genuinely valuable, and it is available without ever running the finished program.

The thing automation cannot do is supply an edge that is not already there. A rule set with no edge, executed perfectly, loses money more consistently and more quickly than the same rule set executed by hand, because the machine does not hesitate, does not skip the setups it does not like, and does not get bored and stop. Precision of execution amplifies whatever the rules actually are.

How an expert advisor runs

The common form of retail automation is an expert advisor, a program attached to a chart inside a trading platform.

Mechanically it is straightforward. The program receives price updates from the platform. On each update it evaluates its conditions against current and historical prices. When a condition is met it sends an order through the same connection a manual order uses, and the broker's server handles it identically. It then manages the position according to its rules, modifying stops or closing out as conditions change.

Three operational facts follow from that structure, and they are the ones that catch people.

The program runs on the terminal, not on the broker's server. It only evaluates anything while the platform is open and connected. Close the laptop and the automation stops. This is why people who run an expert advisor seriously rent a server that stays on, and it is a running cost rather than a detail.

Orders resting on the broker's server behave differently. A stop-loss placed by the program sits on the server and executes whether or not the terminal is running. A rule that says "close the position if this condition appears" does not, because evaluating that condition requires the program to be alive. Knowing which parts of your logic survive a disconnection matters more than it seems.

Everything about the broker's environment is a dependency. Symbol naming, contract sizes, spread behaviour, minimum stop distances and server time are all things an expert advisor relies on, and all things that can change.

The platform's own automation features, including the editor and the strategy tester, are described on the MT5 platform page. Terms used here such as spread, slippage and expert advisor are defined in the trading glossary.

What a backtest shows

A backtest runs the rules against historical price data and reports what would have happened.

What it genuinely gives you is narrow and real. It confirms the rules are unambiguous enough to execute, since a rule set that cannot be coded cannot be tested. It shows how often the conditions occurred, which tells you whether the approach generates enough opportunities to be worth running. It reveals the shape of the equity path, including how long the losing stretches ran and how deep they went, which is information about whether you could have tolerated it. And it exposes obvious failures quickly and cheaply.

That is useful. What a backtest does not do is tell you the strategy works, and the gap between those two statements is where most of the money is lost.

What a backtest hides

Five things, and they compound.

Overfitting

This is the central problem, and it is well documented rather than a matter of opinion.

Any rule set has parameters: lengths, thresholds, filters, times of day. Adjusting them against historical data and keeping the version that performed best is how most retail strategies are developed. The difficulty is that this procedure finds the configuration that best fits the noise in that particular sample, and noise does not repeat.

The research on this is blunt. In Pseudo-Mathematics and Financial Charlatanism, Bailey, Borwein, López de Prado and Zhu show that high simulated performance is easily achievable after testing a relatively small number of strategy configurations, and that the more configurations you try, the higher the probability your backtest is overfit.

Their most important finding is the one that gets quoted least. Under realistic conditions, backtest overfitting leads to negative expected returns out of sample rather than merely zero. An overfit strategy can be expected to lose rather than merely to disappoint, which is a considerably worse starting point than doing nothing at all.

The practical consequence is that a backtest result cannot be interpreted without knowing how many variations were tried before it appeared. A single configuration tested once and performing well is weak evidence. The same result arrived at after two hundred attempts is no evidence at all, and the person showing you the chart rarely volunteers the number.

Cost assumptions

Most backtests apply a fixed spread and no slippage. Live markets supply neither.

Spreads widen around scheduled releases, at session changeovers and in thin overnight liquidity, which means a strategy tested at a constant spread has been tested in a market that does not exist. Slippage is simply absent from most historical simulations, so every fill occurs at exactly the requested price.

Both assumptions flatter the result, and they flatter it most for the strategies that trade most often, because the error is applied per trade. A rule set producing a small average gain per trade can be comfortably positive in a simulation and reliably negative in practice, with nothing about the logic having changed. The costs themselves and how they accumulate at frequency are covered in the article on day trading, and the mechanics of slippage and gaps in order types explained.

Execution assumptions

A simulation fills every order. Reality does not always offer that.

Historical bar data records an open, high, low and close for each period and discards the sequence within it. A backtest that sees price touched both your stop and your target during the same bar has to guess which came first, and the guess is usually generous. Gaps are frequently handled as though trading occurred at every level in between. Partial fills, rejections and minimum stop distances rarely appear at all.

Survivorship

Two kinds, and the second is the one people miss.

In datasets, instruments that were delisted or merged often drop out, so a test on today's constituents is a test on the ones that made it. This matters most on shares and least on major currency pairs.

In strategies, the same effect operates on what you are shown. The automated systems visible in search results, forums and advertising are the ones that happened to perform. The ones that failed stopped being promoted, and nobody publishes the equity curve of a bot that quietly drained an account. The visible population is selected for success, which makes any impression formed from it systematically wrong.

Regime

A backtest covers the period it covers. A strategy tested across three years of a particular interest rate environment has been tested under one set of conditions, and the conditions are not a fixed property of the market.

This is the failure that arrives latest and does the most damage, because by the time it is apparent the strategy has usually been trusted with a larger position.

The running costs

Automation shifts effort rather than removing it, and the costs are ongoing rather than one-off.

  • A machine that stays on. A rented server or a dedicated computer, running continuously, since the program evaluates nothing while the terminal is closed.

  • Development and maintenance time. Writing the rules, then revisiting them whenever the platform updates, the broker changes a symbol specification, or the logic meets a case it was not written for.

  • Monitoring. Checking that the program is running, connected and behaving as intended. This is the cost people are most surprised by, and the next section explains why.

  • Trading costs at machine frequency. A program takes every setup its rules define, which is usually many more than a human would take. Whatever the spread and commission are per round trip, automation multiplies the count.

None of those are large individually. Together they mean an automated strategy needs to clear a higher bar than the same rules run by hand, which is the opposite of the impression most marketing leaves.

How automated strategies fail

Five failure modes, in rough order of how often they catch people.

The rules stop matching the market. This is the central one. Every rule set depends on a market condition being present, and conditions change. A strategy built in a trending market generates losses in a range and has no way to know the difference, because the rules do not contain a concept of being in the wrong environment.

The failure is silent. A program that has stopped working does not announce it. It carries on executing, placing orders, producing results that look like ordinary variance for far longer than you would tolerate if a person were making the decisions. Distinguishing a normal losing stretch from a strategy that has stopped functioning is genuinely difficult, and it is the reason a predetermined rule for switching the thing off has to exist before it is switched on.

Technical breakage. Disconnections, platform updates, expired servers, changed symbol names, altered minimum stop distances. A program can sit idle for a week without anyone noticing, or worse, resume mid-way through conditions it was not designed to re-enter.

Re-optimisation. A strategy performing poorly invites adjustment, and adjusting parameters against the data that just happened is exactly the procedure that produces overfitting in the first place. Each cycle feels like maintenance and functions as further curve fitting, and the strategy becomes progressively more tuned to a past that is receding.

The automation paradox. Having removed yourself from execution, you now have to supervise a system that cannot tell you when it is wrong. The benefit people buy is not having to watch, and the reality is watching something less interpretable than your own decisions.

What automation genuinely solves

Setting the overclaiming aside, several things are real.

It executes consistently. The program takes every setup the rules define, including the uncomfortable ones after a losing streak, which removes a category of error that costs discretionary traders a great deal.

It reacts faster than a person, which matters for approaches where the entry window is measured in seconds.

It applies the same logic across many instruments at once, which is impractical by hand.

And it produces a complete, honest record. Every decision is logged with its inputs, which makes the method evaluable in a way that a manual approach with selective memory never is.

Notice that none of those is an edge. They are improvements in the execution of whatever edge already exists, which is exactly the distinction the opening of this page draws.

On buying a system

The brief answer is to apply the same scepticism you would to any investment offer, because that is what it is.

The structural question answers itself if you sit with it. A strategy that reliably made money would be more valuable run than sold, and the capital required to run it is not large relative to what a genuinely profitable system would earn. Selling access is the rational choice when the revenue from subscriptions is more dependable than the revenue from trading.

ASIC's Moneysmart lists "a trading platform or investment strategy that supposedly beats the market" among the common promises used in investment scams, alongside guaranteed returns, high returns with little risk, and pressure to act quickly. That says nothing about any particular product, and a good deal about which promises tend to precede which outcomes.

If you are evaluating something regardless, the questions worth asking are about process rather than results. How many configurations were tested before this one. What spread and slippage the simulation assumed. Whether the results shown are from live trading or simulation, and over what period. Whether the strategy has been run forward on unseen data rather than only backwards. A seller who cannot answer those has not done the work, and a seller who will not answer them has.

Frequently asked questions

Do trading bots actually work?

Automation executes rules reliably. Whether the rules have an edge is a separate question that automation does not address. A program running rules with no edge produces losses more consistently than a person running the same rules, because it never skips a setup or stops out of discomfort.

What is the difference between a trading bot and an expert advisor?

An expert advisor is the name for an automated program on the MetaTrader platforms. Trading bot is the general term. They describe the same thing: software that evaluates rules against price data and sends orders.

What is algorithmic trading?

Trading decisions made and executed by a program following defined rules. The term covers everything from a retail expert advisor to institutional execution systems, which differ enormously in infrastructure, data and purpose despite sharing the description.

Can I run an expert advisor on MT5 without leaving my computer on?

Not from the terminal alone, since the program only evaluates conditions while the platform is open and connected. Orders already resting on the broker's server remain active, but any logic requiring evaluation stops. This is why continuous hosting is a standard running cost.

How reliable are backtest results?

They reliably show how the rules would have behaved on that data under the assumptions used. They do not establish that the rules will work. The published research finds that strong simulated performance is easy to produce after a modest number of attempts, and that overfit strategies carry negative expected returns out of sample rather than neutral ones.

What is curve fitting?

Tuning a strategy's parameters until it performs well on a particular historical sample, with the result that it has learned the noise in that sample rather than anything that repeats. It is the default outcome of optimising against data you can already see, and it is why the number of variations tried matters as much as the result.

Is automated trading safer than manual trading?

It removes some human errors and introduces technical and structural ones. The leverage, gap exposure and cost structure are identical, since the orders reach the market the same way. A program can also compound a flawed rule faster than a person would.

Do I need to code to automate a strategy?

To write one from scratch, yes, in the platform's language. Rule-builder tools exist that avoid this. The harder requirement either way is specifying the rules precisely enough to be executed, which is a thinking problem rather than a programming one.

How do I know when to stop running a strategy?

Decide before you start, in writing. A drawdown level, a number of consecutive losses, or a change in market condition that the rules were not built for. Without a predetermined threshold, a failing strategy is indistinguishable from an ordinary losing stretch for as long as you want it to be.

How any underlying approach actually works, before automating it, is covered on the forex trading strategies hub, and what indicators can and cannot do in the technical analysis introduction.

Risk warning: CFDs are leveraged products and carry a high level of risk. Losses are calculated on the full position value, can exceed the margin committed to a position, and can consume your entire account balance. Automating a strategy does not reduce these risks and can increase trading frequency and therefore costs. Backtested or simulated results are not a reliable indicator of future performance. CFDs are not suitable for all investors. Make sure you understand how these products work and whether you can afford the risk of losing your money. This article is educational information only. It is not investment advice, a recommendation, or an offer to trade, and it does not endorse or evaluate any trading system, signal service or software vendor. It does not take account of your objectives, financial situation or needs.

Συχνές Ερωτήσεις

Χρειάζεστε βοήθεια για να ξεκινήσετε;

  • Ποια έκδοση FIX υποστηρίζετε;

    FIX 4.4 — το πρότυπο του κλάδου που χρησιμοποιείται από τράπεζες και hedge funds.

  • Ποιο είναι το ελάχιστο ποσό προϋπόθεσης;

    Το FIX API απευθύνεται σε λογαριασμούς από περίπου $50.000· οι ακριβείς απαιτήσεις εξαρτώνται από τον όγκο και τη στρατηγική σας.

  • Υπάρχει χρέωση εγκατάστασης;

    Αξιολογείται κατά περίπτωση βάσει όγκου και στρατηγικής. Δεν υπάρχουν χρεώσεις χρήσης API.

  • Μπορώ να κάνω δοκιμή πριν ενεργοποιήσω τον λογαριασμό;

    Ναι — ένα πλήρες περιβάλλον demo για την επαλήθευση ροής εντολών, latency και απόδοσης πριν από την παραγωγική χρήση.

  • Προσφέρετε co-location;

    Ναι — επικοινωνήστε με το τμήμα θεσμικών πελατών για λεπτομέρειες.

  • Τι υποστήριξη λαμβάνω κατά την ενσωμάτωση;

    Μια τεχνική ομάδα σας υποστηρίζει κατά τη διάρκεια της ενσωμάτωσης και των δοκιμών, με παρακολούθηση 24/7 μόλις τεθεί σε λειτουργία.

Εκτεταμένο Τμήμα Συχνών Ερωτήσεων Εκτεταμένο Τμήμα Συχνών Ερωτήσεων

Ένα προϊόν που πουλάει μόνο του.

Μη χάσετε
τις ενημερώσεις μας

Διαβάστε πρώτοι τα νέα μας άρθρα
και αποκλειστικούς οδηγούς.

Χρησιμοποιούμε cookies

Χρησιμοποιούμε cookies για να βελτιώσουμε την εμπειρία σας στον ιστότοπό μας. Συνεχίζοντας την περιήγηση, συμφωνείτε με τη χρήση cookies σύμφωνα με την Πολιτική Cookies.

Απαραίτητα

Επιτρέπουν την ασφάλεια και τις βασικές λειτουργίες

Προτιμήσεις

Επιτρέπουν εξατομικευμένο περιεχόμενο και ρυθμίσεις

Ανάλυση

Επιτρέπει την παρακολούθηση της απόδοσης

Μάρκετινγκ

Επιτρέπει την εξατομίκευση και παρακολούθηση διαφημίσεων