Algorithmic trading, and why backtests lie

Automating a strategy removes hesitation, fatigue and the temptation to move a stop. It does not make the strategy work, and the tool most people use to check that it does is the one most likely to mislead them.

The exposed brass mechanism of an antique music box, pins and comb visible
It will play the same tune perfectly every time. Whether it is the right tune is not a question the mechanism can answer.

An algorithm is a set of rules specific enough for a computer to follow: when this condition is true, place this order, with this size, and close it under these conditions. Nothing about that requires sophistication. A two-line moving-average crossover is an algorithm.

What automation genuinely gives you is consistency. The rules execute the same way at 3am as at 3pm, they do not widen a stop because the position is uncomfortable, and they do not skip the signal after three losses. For a strategy that works, those are real advantages. For one that does not, automation simply loses money faster and more reliably.

What the hundred brokers we rate actually support, from their own platform records.

  • 86support Expert Advisors or automated strategiesOverwhelmingly via MetaTrader, where MQL4 and MQL5 are the standard route.
  • 68offer API accessFIX or REST, for strategies running outside a retail platform.
  • 14explicitly do not support automationIncluding Plus500, eToro, XTB, Trading 212, Webull and Questrade.

The fourteen are mostly proprietary-platform brokers. If automation matters, that is a broker filter rather than a preference.

What a rule set has to specify

A strategy is only automatable once every one of these is unambiguous. Most discretionary traders discover, at this point, that their method is less defined than they thought - which is a useful discovery on its own.

  1. Entry condition

    The exact, testable state of the market that triggers a trade. Not "when the trend looks strong" but a condition with a value that is either true or false at each bar.

  2. Direction

    Long, short, or both. Many strategies behave quite differently on each side and are worth testing separately.

  3. Position size

    Fixed, a percentage of equity, or volatility-adjusted. This is the parameter that decides whether a losing run is survivable, and it is covered in full in position sizing.

  4. Exit conditions

    Stop, target, trailing rule, time limit, opposing signal, whichever combination applies, stated as precisely as the entry.

  5. Filters and limits

    When not to trade: sessions, spread thresholds, scheduled announcements, maximum open positions, maximum daily loss. These usually matter more than the entry signal does.

A backtest is not evidence that a strategy works. It is evidence that a set of rules would have worked on data you already had.

Why that distinction is the whole subject

Given enough parameters and enough attempts, a strategy can be tuned to produce an excellent equity curve on any historical dataset. That is not skill, it is curve-fitting, and the more parameters a system has the easier it is to do accidentally.

The tell is fragility. If a system returns 200% with a 14-period moving average and loses money at 13 and 15, it has not found something about the market - it has found something about that specific stretch of data. A robust rule set degrades gracefully as its parameters move.

The costs a backtest usually forgets

Historical testing tends to assume perfect fills at the displayed price, no commission, a constant spread and no gaps. Live trading has none of those.

Spread is the big one: MetaTrader's default backtest often uses a fixed spread that bears no relation to the widening around news and rollover. Commission has to be added deliberately. And slippage compounds - a strategy taking 10,000 trades with an average 0.1 pip of adverse fill has given away 1,000 pips that the test never charged it for.

For a strategy targeting 300 pips a trade this is a rounding error. For one targeting three pips it is the entire result, which is why short-target automated strategies are so much more likely to look profitable in testing than in an account.

Where it runs, and what happens when it stops

A MetaTrader Expert Advisor runs inside the terminal on your machine. Close it, lose power, lose the connection, or let the laptop sleep, and the strategy stops - possibly with positions open and no logic managing them.

This is why anyone running an EA seriously runs it on a virtual private server: a machine that stays on, keeps its connection, and sits close to the broker's own servers. It is the same consideration behind platform-side trailing stops failing to update when the terminal closes.

A VPS reduces latency and improves reliability. It does not improve a strategy, and moving a losing system to a faster machine makes it lose more efficiently.

Latency: when it matters and when it is a distraction

Genuine high-frequency trading competes on microseconds, uses colocated hardware and is not a retail activity. If your strategy holds positions for hours, the difference between 4ms and 150ms execution is irrelevant to it.

Latency starts to matter when the edge is small relative to how fast prices move - short-term systems, news reaction, anything scraping a few pips. If you are not doing that, spending money on infrastructure is optimising the part of the problem that is not the problem.

Buying somebody else's

Commercial EAs are sold with equity curves, and the curve is a marketing asset. A seller can generate a flawless one by fitting to history, by running martingale sizing that has not yet failed, or by showing a demo account where fills cost nothing.

The same questions apply as to a copy-trading provider: how long is the live record, what is the maximum drawdown, does position size grow after losses, and were the results produced on a real account with real costs. If the answer to the last one is a backtest, you have been shown nothing at all.

Before running a strategy on live money

  • Are all the rules unambiguous enough to code without judgement calls?
  • Was it tested on data not used in development?
  • Does it still work with parameters slightly changed?
  • Does the test include realistic spread, commission and slippage?
  • How many trades are in the sample?
  • What is the worst historical drawdown, and would I have kept it running?
  • Does position size ever increase after a loss?
  • What happens if the machine or connection goes down mid-trade?
  • Is there a maximum daily loss or a kill switch?
  • Has it run on a demo or small live account long enough to compare against the test?

Questions people ask about algorithmic trading

Do I need to be able to code?

To build your own from scratch, broadly yes: MQL4 or MQL5 for MetaTrader. Visual strategy builders and marketplaces exist and reduce the requirement without removing the need to understand what the rules do.

Is algorithmic trading the same as an Expert Advisor?

An EA is one implementation of it: MetaTrader's name for an automated strategy. Algorithmic trading also covers systems running through APIs and outside retail platforms.

Is automated trading more profitable?

It is more consistent. Consistency helps a profitable strategy and does nothing for an unprofitable one except apply it more reliably.

Why did my EA work in testing and lose live?

Most often curve-fitting, or unrealistic execution assumptions in the test: fixed spread, no commission, perfect fills. Both are extremely common and both flatter short-term strategies most.

Do I need a VPS?

If a strategy must run continuously, yes, a terminal on your own machine stops when the machine does. It improves reliability and latency, not the strategy.

Can any broker run automated strategies?

No. 86 of the hundred we rate support them; 14 do not, mostly those running proprietary platforms. Some brokers also restrict particular techniques in their terms.

Are commercial EAs worth buying?

Judge them the way you would a copy-trading provider: live record length, maximum drawdown, whether size grows after losses, and whether the results came from a real account rather than a backtest.

Ready to put this to work?

Our questionnaire ranks all 100 brokers against your own answers in about a minute - including, if it matters to you, filtering out the ones whose leverage and protections do not suit how you intend to trade.

Find my brokerBrowse all 100 reviews

Nothing here is financial advice. Leveraged products can lose more than they make.