What algorithmic trading actually is
Algorithmic trading is the use of computer programs to make the decision and execute the trade according to a set of rules — covering the whole spectrum from a bank executing a large institutional order in a way that minimises market impact, through to a systematic fund holding a position for weeks and a market maker who is constantly quoting. The commonality in all of these cases is that a system, not a person, makes the decision at the moment it is made.
It's worth separating out two activities which are so often lumped together. Alpha generation is the business of deciding what to hold and when to hold it; execution is the business of deciding how to get in and how to get out. Most of the automated volume in the industry is execution, and most of the durable value in algorithmic trading systems is to be found in execution too. It's a better-defined problem and it has a much clearer measure of success.
Nothing in this article is investment advice. It's a description of how these systems are built, which is a different issue to whether or not any particular strategy is a good one.
The main strategy families
- Arbitrage. Exploiting price differences for the same or equivalent instrument across venues or forms. In concept the cleanest, in practice the hardest, as it is a speed race and the opportunities close as participants arrive.
- Mean reversion. Betting that a price which has moved away from a statistical relationship will return to it. Works until the relationship breaks — and it breaks exactly when the position is largest and the loss is greatest.
- Trend following and momentum. Betting that a move continues. Wins very infrequently but with big payoffs, which in turn requires the discipline to stick with it through long drawdowns that can easily feel like the strategy has simply stopped working.
- Statistical models. Multi-factor models which attempt to estimate expected returns from a large number of inputs. This is the area where machine learning is most frequently applied and where overfitting does the most damage.
- Market making. Quoting both sides continuously and earning the spread, while managing the accumulated inventory risk. Fundamentally an inventory and adverse-selection problem.
- Execution algorithms. Not alpha at all — a large order being split across time and venues to minimise market impact. The largest category by volume and the most measurable.
How a trading system is put together
The architecture is more revealing than the strategy, as that's where the majority of the failures come from.
- Market data ingestion. Normalising feeds from a number of venues, dealing with gaps and corrections, and consistent timestamping. If this is done in a sloppy fashion, it silently corrupts everything that comes downstream.
- Signal computation. Taking the raw data and turning it into the features that the strategy actually uses — and doing it in exactly the same way in backtest as in live, which is harder than it sounds and a very common cause of divergence.
- Portfolio construction. Taking the signals and converting them into target positions subject to constraints: exposure limits, concentration rules and capital allocation.
- Order generation and routing. Working out what type of order, what size, what venue and when to place it, in order to get to the target position at a reasonable cost.
- Risk management. Pre-trade checks which reject orders that breach limits, and real-time monitoring which can halt trading. This layer must be independent of the strategy logic.
- Reconciliation and reporting. Confirming that the positions the system thinks it holds are in fact the same as those reported by the broker and the custodian. A divergence in this area is an emergency, not a discrepancy.
The consistency between the backtest and live execution needs to be stressed. If the research code and the production code compute a feature differently — however slightly — then the strategy you backtested is not the strategy you actually deployed. The standard way of dealing with this is to ensure that the exact same computation path is used in both.
Why most backtests are wrong
A backtest is a simulation, and simulations always flatter their authors. These are the errors you see most often, in rough order of the damage they do.
| Error | What it looks like | Correction |
|---|---|---|
| Lookahead bias | Using data not available at decision time | Timestamp everything by availability, not by event |
| Survivorship bias | Testing on instruments that still exist today | Use a universe including delisted instruments |
| Unrealistic fills | Assuming execution at the mid or the close | Model spread, slippage, and partial fills |
| Ignoring costs | Gross returns presented as net | Include commission, fees, financing, and impact |
| Overfitting by iteration | The hundredth parameter set looks excellent | Hold out data never used for selection |
| Regime dependence | Tested only on a favourable period | Test across regimes, including crises |
| Capacity ignored | Strategy assumes unlimited liquidity | Model impact as a function of size |
The pattern is that each of these errors tends to improve the results rather than degrade them. That asymmetry is the clue: if a backtest looks great, the first thing you should think is that something is wrong with it.
Where machine learning genuinely helps
Financial markets are the most unforgiving environment for machine learning. The signal-to-noise ratio is very low, the data is non-stationary, and any pattern that is exploitable is quickly competed away as it's discovered. The classic and very expensive mistake is to apply a flexible model to price data and expect to be able to predict direction.
- Execution cost prediction. Forecasting market impact and slippage for a given order size and market state is a well-posed supervised problem with a huge amount of labelled data, and that's precisely where machine learning is most likely to deliver.
- Alternative data processing. Extracting structured signal from text, imagery or transaction data. The modelling is pretty standard; the advantage is in having the data and processing it faster.
- Regime classification. Identifying what market state you're in, so that a strategy can adjust its exposure rather than trying to predict returns directly.
- Risk estimation. Forecasting volatility and correlation, which is far more tractable than forecasting returns and is directly useful for sizing.
- Anomaly detection. Spotting when the live behaviour differs from what the system expects — a monitoring application which picks up problems before losses have built up.
Our market movement forecasting case study demonstrates this in practice. The system generates a set of candidate directional signals which are then assessed by the research team — the human has the final say, and the model is simply used to focus the search.
Risk controls that matter
- Pre-trade limits, independently enforced. Maximum order size, position and exposure are checked outside of the strategy code, so a strategy bug cannot circumvent them.
- Kill switches with clear triggers. Defined conditions under which trading is halted, and named people who can invoke a halt without having to obtain permission first.
- Loss limits at several horizons. Daily, weekly and drawdown limits which reduce or stop trading, agreed in advance rather than debated on a bad day.
- Continuous reconciliation. Automated comparison of internal positions against broker records, with divergence treated as an incident.
- Fat-finger and sanity checks. Rejection of orders which are absurd in relation to normal size or price — the cheapest control available and in many cases the most effective.
- Graceful degradation. Defined behaviour for when a feed dies or a venue drops off. The sensible default is usually to stop trading and flatten, rather than carry on trading on stale data.
How SoftmaxAI builds trading infrastructure
We build our financial systems the same way we build everything else. We have a written, client-approved specification prior to any code. We have an agent-accelerated build led by senior engineers. And every decision that matters is owned by a human.
- Data and reproducibility first. Point-in-time correct data with availability timestamps, and a single computation path shared between research and production, so the strategy being tested is the one that's actually deployed.
- Honest evaluation. Out-of-sample discipline, realistic cost and fill modelling, and capacity analysis. We report what a result is actually worth, including when the result is disappointing.
- Risk as an independent layer. Limits and halts are enforced outside of the strategy logic, so a bug in a model can't disable the control that contains it.
- Human-owned decisions. The model output narrows where to look; the allocation and risk decisions remain with your own research and risk teams. That's the pattern in our finance work.
Algorithmic tradingBacktestingExecutionRisk managementMarket microstructureQuantitative financeTime seriesMLOps