How algorithmic trading strategies differ from execution algorithms
Key point
one program decides what to buy, while another decides how to buy it without waking the market. These are different tasks, and they are tested differently.
In traders’ conversations, the word “algorithm” merges two entirely different things. In its review of wholesale markets, the British regulator cites definitions from the European standard, and this is the most useful distinction I have encountered.
“Investment decision algorithms make automated trading decisions by determining which financial instrument should be purchased or sold. Order execution algorithms optimise order-execution processes by automatic generation and submission of orders or quotes, to one or several trading venues once the investment decision has been taken.”
- Financial Conduct Authority, Algorithmic Trading Compliance in Wholesale Markets, February 2018, https://www.fca.org.uk/publication/multi-firm-reviews/algorithmic-trading-compliance-wholesale-markets.pdf
The decision algorithm answers the question, “Should we enter or not?” The second algorithm receives a decision that has already been made, and its job is to spread the order over time so that it does not move the price against itself. An SEC report lists common families of the second type: VWAP, TWAP, implementation shortfall minimization, and trading a specified percentage of market volume.
The distinction has practical consequences. The hypothesis that “this setup provides an edge” can be tested on historical data. Execution quality cannot be tested on historical data at all: your order is not present in the order book, so neither is its effect on the price. If the basic structure of a trading algorithm is still unclear to you, start with the explanation of how an algorithm works and how it is tested; I will not repeat it here.
What types of algorithmic trading strategies are there?
Key point
there are five classes, distinguished by one thing: where the edge comes from.
The list is short, but each item is a profession in its own right:
- Execution algorithms. They split a large order so that the average execution price remains close to the market price. The edge comes from reducing costs, not from prediction.
- Passive market making. It places limit orders on both sides and earns from the spread and exchange rebates for providing passive liquidity.
- Arbitrage. It captures price discrepancies between related instruments and waits for convergence. The direction of the market does not matter here.
- Structural strategies. They exploit the structure of the market itself: differences in data-receipt speed, the characteristics of order types, and delays experienced by particular participants.
- Directional strategies. They open a short-term long or short position in anticipation of a price move and usually take liquidity from the order book.
High-frequency trading is sometimes named as a sixth category, but this is like comparing a profession with typing speed. HFT is an operating mode in which any of the classes above can exist.
What SEC and MiFID II regulators require before a trading algorithm is launched
Key point
there is no statutory definition of HFT, but there is a strict approval process: a testing methodology, a separate environment, limits, and a kill switch must all be in place before the first live order.
The U.S. regulator’s report states the classification directly:
“The 2010 Equity Market Structure Concept Release described four broad types of short-term high frequency trading strategies: passive market-making, arbitrage, structural, and directional.”
- Staff Report on Algorithmic Trading in U.S. Capital Markets, SEC, August 5, 2020, https://www.sec.gov/files/Algo_Trading_Report_2020.pdf
The same report states explicitly that there is no statutory definition of HFT. Instead, it gives a set of five characteristics: extremely fast programs; colocation and individual data feeds; very short position-holding periods; a large number of orders canceled almost immediately after submission; and ending the day with a position close to zero. It also specifies that all five need not be present at the same time.
For the foreign exchange market, the Bank for International Settlements separates the same concepts: its materials contrast pure HFT with the algorithmic execution of large one-way trades. In other words, speed and purpose are different dimensions and should not be confused. The Bank of Russia describes the characteristics in similarly qualitative terms in its review of high-frequency trading; it provides no numerical market share there.
European rules also answer the question of what a regulator actually considers algorithm testing. It is not a backtest.
- 1
Documented testing methodology
Before launch and before any material update
- 2
Venue compatibility testing
The algorithm must not disrupt another party’s trading system
- 3
Separate test environment
Isolated from the live environment
- 4
Deployment with strict limits
Limits are set in advance, before the first live order
- 5
Instant cancellation control
Immediately cancels any or all unexecuted orders
- 6
Annual validation
Systems, algorithms, and strategies are reviewed once a year
The British review adds a requirement that retail traders usually overlook: the algorithm must demonstrate that it “works effectively in stressed market conditions.” A test conducted on a calm segment of historical data does not satisfy this requirement.
Which classes can you test yourself, and which depend on infrastructure?
Key point
directional rules can be tested on closed bars using an ordinary tester; market making, arbitrage, and structural strategies fundamentally cannot be tested without access to the infrastructure.
The boundary between classes of algorithmic strategies is determined by the source of the edge; code complexity has nothing to do with it. If the edge lies in the rule, it is visible in price history. If the edge lies in speed or position in the order queue, it is absent from price history because that history contains neither the queue nor your latency.
Edge in the rule
Edge in speed and access
- 1.Directional rules
- 2.Pairs arbitrage
- 3.Market making and HFT
The scale of the infrastructure barrier is measured in milliseconds. Moscow Exchange publishes the minimum response times for its connection methods: 0.02 ms for colocation, 5 ms for a dedicated ConnectME line, 34 ms for points of presence, and 100 ms for the regular internet. Colocation is five thousand times faster than the internet, and no amount of code optimization can close that gap.
| Class | Testable hypothesis | Minimum data | Main simulation error | Infrastructure barrier |
|---|---|---|---|---|
| Directional | the rule provides an edge after costs | closed bars for one instrument | overfitting parameters to historical data | low |
| Arbitrage | the pair diverges and then converges again | synchronized quotes for two instruments | unsynchronized data and hidden carry costs | medium |
| Passive market making | the spread covers adverse selection | order book and time-and-sales data | the tester does not model the order queue | high |
| Structural | the data lead is persistent | raw exchange data feeds | latency is not incorporated into the test at all | very high |
| Execution algorithms | the average price beats the benchmark | your own orders | your market impact is absent from historical data | medium |
The conclusion for a retail trader is simple: test directional rules. Everything else can be studied to understand the market, but it should not be fed into a conventional tester or treated as a meaningful result.
Suitable if
- You have a directional rule based on closed bars, with the entry, exit, stop-loss order, and position size defined in advance
- You use one instrument, one timeframe, and a holdout sample that is revealed last
- You are comparing two versions of the rules on the same holdout sample
Not suitable if
- You are testing passive market making: the tester contains neither an order queue nor adverse selection
- You are testing arbitrage between related instruments: the discrepancy lasts for seconds, while a bar provides only four prices
- You are testing structural strategies based on different data-receipt speeds: they cannot be reproduced without a presence at the exchange
How to formalize a directional hypothesis into unambiguous rules
Key point
as long as a hypothesis is expressed only in words, it cannot be tested; the rule must give an unambiguous yes-or-no answer on every closed bar.
The phrase “I buy a pullback in a trend” is not a strategy. It contains three undefined words, each of which becomes a parameter you will be tempted to tweak during testing. Section 3.9 of the British regulator’s review requires the following to be documented before testing: the theoretical framework, behavioral characteristics and key assumptions, the composition of the input data, and the calculation procedures.
The practical minimum for one rule looks like this. The entry is a logical expression based on values known when the bar closes. The exit has its own expression of the same kind; “when things look bad” is not a rule. The stop-loss order and position size are defined in advance, before the first run. The timeframe must also be stated explicitly, because the same rule on a different scale is a different strategy.
The components of a strategy’s rules are examined in detail in the article on what constitutes a testable trading strategy. The important point here is that the number of free parameters must be counted before the first run. Seven binary parameters produce one hundred and twenty-eight variants, which is already dangerous territory: the longer the search, the easier it is to find a rule that works only on that particular history.
Why arbitrage and market making cannot be reduced to an ordinary signal
Key point
these classes derive returns from market microstructure, which the tester does not reproduce: it has neither an order queue nor adverse selection.
A passive market maker places limit orders on both sides and earns from the spread. The SEC report identifies its main risk as adverse selection: a situation in which the price quickly moves against a posted quote. This risk does not exist in a conventional tester: your limit order is filled as soon as the price touches the level, and nobody gets there before you. In a real order book, there is a queue ahead of you, and your place in that queue determines whether your quote or someone else’s is filled.
Arbitrage fails for a different reason. A price discrepancy between related instruments lasts for seconds, while a test based on closed bars sees only four prices for each minute: the open, high, low, and close. Even if the discrepancy appears in the data, the test never asks whether you could have entered it in time.
This leads to a practical rule. An attractive equity curve produced by arbitrage or market-making logic in a conventional tester is an artifact of simplification. Such algorithmic strategies are tested in a live-like environment with real latency, and exchanges specifically provide test access that replicates a production connection. A retail trader usually does not have this environment.
How to choose the market, data, and horizon before the first test
Key point
first fix the instrument, data quality, and division of the history into segments; only then run the first calculation.
Data quality is measurable. The MetaTrader 5 tester calculates History Quality as the proportion of valid one-minute bars and explicitly flags gaps in the historical data and bars with a volume of one trade at different prices as defective. The spread is taken from historical data; the tester has no spread model of its own. Therefore, every conclusion from a test is limited by the quality of the segment on which it was obtained.
The second question is the length of the historical record. A paper by four mathematicians in Notices of the American Mathematical Society gives an uncomfortable estimate: with five years of data, no more than forty-five independent model configurations can be tested; otherwise, the training-sample result will be excellent while the result on new data will be zero. With two years of history, as few as seven configurations are enough to reach the limit.
Step 1
Instrument and timeframe selected
One instrument and one scale, with neither changed later
Step 2
Data quality checked
Historical gaps and suspicious bars identified before testing
Step 3
Training period
Parameters are fitted here and only here
Step 4
Holdout sample
Not revealed until the parameters have been fixed
Step 5
Real-time forward test
Fresh data that was not included in any previous segment
Even mass-market terminals have a built-in forward period: the MetaTrader 5 tester can set aside one-half, one-third, or one-quarter of the period, specifically to prevent parameters from being overfitted to individual segments of historical data. The second testing environment is covered separately in the article on how to test an Expert Advisor in the MetaTrader tester.
How to compare two strategies on the same holdout sample
Key point
a comparison is fair only when everything except the rules themselves is identical for both algorithms, and the holdout period is revealed exactly once.
A common mistake looks harmless: the first trading algorithm is tested over one period, the second over another, and the results are compared. Such a comparison says nothing because the conditions, rather than just the rules, were different.
- 1
One instrument and one timeframe
Both algorithms are evaluated on exactly the same data
- 2
Identical commissions and slippage
Values are recorded before the run, not selected afterward
- 3
One historical-data split
Both use the same training and holdout boundaries
- 4
Parameters fixed
Fitting is completed before the holdout period is revealed
- 5
Holdout revealed once
A second run on the same data is no longer independent
- 6
Decision recorded in advance
The selection criterion is defined before the result is visible
The fifth step is violated most often. You look at the holdout result, adjust a parameter slightly, and look again—and the holdout sample is no longer held out. Formally, you are now fitting on the holdout set, and all protection against overfitting has disappeared. The professional alternative is called a rolling window, or walk-forward analysis: parameters are calibrated on one window, the result is measured on the next segment, and then the window advances.
You should also record what counts as a victory. If the criterion is not defined before the result is viewed, the algorithm with the most attractive curve will always be declared the winner.
How to account for commissions, slippage, and the execution model
Key point
each class has its own primary source of costs, and the tester often sets it to zero by default.
What matters is not the setting itself, but its significance for your class. For a directional rule on a daily chart, commissions hurt the most. For a class that trades frequently, slippage and position in the queue hurt more: QuantConnect’s default brokerage profile uses a zero-slippage model, and an attractive curve with those settings means nothing.
A study of the U.S. market by NBER researchers shows how decisively this affects the outcome. Anomalies with one-sided monthly turnover below fifty percent still produce a statistically significant premium after costs. Those with higher turnover generally do not. Costs eliminate entire families of algorithms.
The article on backtesting an algorithm explains exactly where to set commissions, the slippage increment, and the tick mode in a specific terminal; there is no reason to repeat those settings here.
How to eliminate lookahead bias and parameter overfitting
Key point
these are two different defects: the first is fixed in the code, while the second can be controlled only through disciplined searching.
Lookahead bias means using data that did not yet exist when the decision was made. TradingView’s documentation identifies common mechanisms: nonstandard chart types with prices that never existed in the market, recalculation after an order is executed, and requesting a higher timeframe without an offset. A related problem is repainting, where historical and real-time logic diverge; the article on non-repainting indicators explains how to detect it.
Overfitting works differently and cannot be cured in the code. Halbert White’s article in Econometrica puts it this way:
“Even when no exploitable forecasting relation exists, looking long enough and hard enough at a given set of data will often reveal one or more forecasting models that look good, but are in fact useless.”
- Halbert White, A Reality Check for Data Snooping, Econometrica, 2000, https://users.ssc.wisc.edu/~bhansen/718/White2000.pdf
A related conclusion comes from NBER researchers: when factors are tested on a large scale, the conventional t-statistic threshold of 2.0 is inadequate and should be raised to approximately 3.0. In practical tester terms, count how many variants you have tried and demand a larger margin of confidence from the result as the search grows longer.
This has a separate implication for the map of strategy classes. A directional rule is more likely to suffer from overfitting because it has many parameters and testing them is cheap. Arbitrage and market making are more likely to suffer from lookahead bias because their results depend on the order of events within a bar, and price history simply does not contain that sequence.
Risks and limitations
Key point
a strategy’s class does not make it profitable, and a backtest is not a promise of future results.
- Historical performance does not carry over to the live market automatically: costs consume part of the edge, while another part disappears when the market regime changes.
- Past results do not guarantee future results, and no tester changes that.
- Infrastructure-dependent strategy classes are technically inaccessible to retail traders, and no tester setting can bypass that barrier.
- The classification in this article is based on regulatory documents and is not the only possible one: the SEC report has no separate categories for mean reversion and statistical arbitrage.
- Trading involves the risk of losing capital; position size is calculated before entry, and the mechanics are explained in the article on risk per trade.
Disclaimer. This is not personalized investment advice. Markets are volatile, and trading involves the risk of losing capital. Past results do not guarantee future results.
Sources
-
- SEC: Staff Report on Algorithmic Trading in U.S. Capital Markets — four classes of short-term strategies, five characteristics of HFT, VWAP and TWAP execution algorithms, and the definition of colocation.
-
- Delegated Regulation (EU) 2017/589, RTS 6 — testing methodology, a separate test environment, deployment limits, and an instant order-cancellation control.
-
- FCA: Algorithmic Trading Compliance in Wholesale Markets — the distinction between decision algorithms and execution algorithms, testing requirements, and documentation content.
-
- FINRA: Regulatory Notice 15-09 — independence of testing from development, control of code changes, and deployment through a limited pilot.
-
- CFTC: Electronic Trading Risk Principles — mandatory pre-trade controls on the venue side.
-
- BIS: High-frequency trading in the foreign exchange market — the distinction between pure HFT and the algorithmic execution of large orders.
-
- Moscow Exchange: connections to trading systems — minimum response times by connection method and the colocation test environment.
-
- Bank of Russia: high-frequency trading, volumes, and impact — an estimate of the share of high-frequency participants in the Russian market.
-
- TradingView: Pine Script, strategies, and repainting — the broker emulator, commissions and slippage, and execution after a bar closes.
-
- TradingView: unrealistic results caused by peeking into the future — three mechanisms for accessing future data and how to eliminate them.
-
- MQL5: testing trading strategies — synthesizing ticks from one-minute bars, historical spreads, and the requirement to recheck coarse testing modes.
-
- MetaTrader 5: strategy optimization — forward periods of 1/2, 1/3, and 1/4 and their purpose.
-
- QuantConnect: slippage models — zero slippage in the default brokerage profile.
-
- Bailey, Borwein, Lopez de Prado, Zhu. Notices of the AMS, 2014 — the maximum number of configurations for a given length of historical data and definitions of training and holdout samples.
-
- Halbert White. A Reality Check for Data Snooping, Econometrica, 2000 — the definition of data snooping and why a long search will always find something.
-
- Harvey, Liu, Zhu. NBER Working Paper 20592 — the t-statistic threshold when many factors are tested.
-
- Novy-Marx, Velikov. NBER Working Paper 20721 — how transaction costs consume the premium of high-turnover strategies.
-
- MetaTrader 5: strategy tester report — the History Quality metric and what counts as defective one-minute data.
Frequently asked questions
How should a beginner start algorithmic trading?
Start with one directional rule for one instrument and one timeframe. The rule must give an unambiguous yes-or-no answer on a closed bar and have a predefined exit and position size. Then divide the history into a training period and a holdout sample, fit the parameters only on the first, and reveal the second only once. Do not begin with market making, arbitrage, or high-frequency strategies: they cannot be tested honestly without access to exchange infrastructure.
Which algorithmic trading strategies are the most profitable?
There is no such answer, and any specific answer to this question should be treated as advertising. Profitability depends on the market, market regime, costs, and execution quality, not on the name of the class. A more useful question is which class you can honestly test with the resources available to you. For a retail trader, that means directional rules, because their edge lies in the rules themselves rather than in the speed of access to the venue.
How does algorithmic trading differ from a trading robot?
Algorithmic trading is an approach in which a program, rather than a person, generates decisions and orders. A trading robot, or Expert Advisor, is a specific program that executes predefined rules. A robot is therefore a tool used in algorithmic trading, not a synonym for it. The distinction matters when testing: you test the strategy as a set of rules, not the robot as code, and separately verify that the code executes those rules without errors.
How much data is needed to test an algorithmic strategy?
It depends not on the calendar but on the number of variants tested. The estimate given in an article in Notices of the American Mathematical Society is as follows. With five years of data, you cannot test more than forty-five independent configurations; otherwise, an excellent training result can coexist with a result of zero on new data. With two years of history, the limit falls to seven configurations. The authors specifically note that the length of the historical record is a necessary but not sufficient condition.
Does algorithmic trading require expensive exchange access?
Not for directional strategies based on closed bars: a regular brokerage account and terminal are sufficient. For anything that makes money from speed, yes, and the difference is measurable. Moscow Exchange lists the minimum response times for its connection methods: 0.02 ms with colocation versus 100 ms over the regular internet. If an idea depends on that gap, it cannot be tested or operated without placing equipment at the exchange.








Comments
Source comments are not translated and are never replaced with Russian text.