The Perfect is the Enemy of the Good
Conventional wisdom seems to divide investors into two classes - those that invest millions in low-latency trading infrastructure, and those that don’t. This binary distinction is convenient but damaging. The predominance of this narrative causes many traders to resign themselves to inadequate infrastructure and inferior execution quality.
In this article we’ll explore how traders in any asset class can significantly improve latency and trading performance without needing to join Tier 1 firms and resorting to hardware-accelerated tick-to-trade solutions.
Debunking Myths
We’ll surface some of the surprising contributors to latency, and debunk a few of the common myths surrounding this topic, among them:
“Latency doesn’t matter” in the cloud, in crypto, in DeFi, etc.
You can’t improve latency without investing large amounts of time and effort
Latency Matters
Many market participants believe that latency only matters if you’re trading high-frequency. Mainstream asset managers are mostly low-frequency investors1, and “to a man with a hammer, everything looks like a nail”… These investors are forecasting with long-term cross-sectional analysis of large datasets, with long anticipated holding periods (multi-day if not multi-month). They also tend to be deploying relatively large amounts of capital. Other categories of investors that can disdain latency are those with unique insights into fundamentals, who are igniting momentum as copy-trading leaders or who are exploiting privileged market access.
None of these perspectives are relevant or valuable to active traders with limited capital… and it is with such people (and bots) in mind that I write this article.
Let’s imagine Joe, an individual investor using a trader workstation to trade stocks, FX or crypto via a retail broker or a crypto exchange. As you would expect, Joe has set up a number of automated indicators to signal when a short-term price movement is confidently forecast. As soon as his signal is triggered, he will place an order to buy or sell. In any popular market, Joe will not be alone and numerous other traders will be reacting to similar if not identical indicators. If Joe can get his order matched and executed before these competitors, he will get a better price. The best way of assuring that is for Joe to A] react to the signal as fast as possible and emit his order, and B] send that order to his broker via the fastest possible path. Indicators are driven by market data updates known as “ticks”, and A+B together are known as “tick to trade”.
Slippage is Evil
Just as Joe gets a better price from executing sooner, he gets a worse price from executing later. This degradation of price is “slippage” - which directly impacts Joe’s trading profits and it is exacerbated by high latency.
Accelerate!
Although this is unfamiliar territory for many low-frequency institutional asset managers, every part of the business of receiving market data, generating trading signals and emitting orders can be dramatically slowed or accelerated by software choices. For automated market makers this is a core competency, but retail investors can improve their execution by attending to these matters.
Root Causes of Latency and Jitter
Those who’ve systematically analyzed latency in trading systems know that the root causes are often highly counter-intuitive. Here are the worst offenders in rough order of their potential impact. Even retail investors can improve latency by changing or relocating their online trading infrastructure.
“Hops” - or the number of separate systems involved in processing the flow. Reducing the number of hops is highly impactful. Hops include remote data stores and market data systems.
“Proximity” - or the distance that messages need to travel. “Distance” is network distance, and while this is correlated with geography it is also heavily influenced by network infrastructure. “Co-locating” involves deploying infrastructure in the same data center as your broker or market. Retail investors may well be able to re-locate cloud infrastructure closer to their brokers for better latency.
Slow Data Stores - trading generates updates to data and these workloads are known as “write intensive” - waiting for slow data stores to complete writes is a common problem.
Data Transformation - trading is performed by sending messages in various formats - the predominant formats are JSON and FIX, and both are regrettably inefficient. Conventional wisdom in software engineering is that such “micro-optimizations” are only marginally beneficial - many modern software developers instinctively disdain them and are shocked by the outsized impact such improvements can have. In a large high-profile project I was involved in for a prime broker, it turned out that an incredible 30% of all tick-to-trade time was needlessly converting numbers between different formats.
Software Internals - common software practices such as dynamic memory allocation and parallel processing cause sudden delays, spiking latency. These hiccups cause latency to become unpredictable and volatile. The volatility of latency is known as “jitter” - and keeping jitter down is just as important as reducing average latency. Inhibiting jitter requires adopting programming languages and software frameworks with fine control of memory allocation and concurrency to ensure predictable sustained performance. C++, C and Rust predominate in this domain.
How to Accelerate
So, to accelerate trading performance we need to:
Eliminate hops
Move closer to brokers and markets
Speed up data stores (or defer writing to them altogether)
Minimize transforming data
Adopt (or build) efficient trading software
In subsequent articles, we’ll dive into each of these in turn.
Market-making, volatility trading and many other institutional trading strategies are latency sensitive