Statistical-arbitrage: Mean Reversion Trading
Course: Cointegration, ADF, CADF, Johansen-test, Risk management
In the following educational post, I will examine mean-reversion trading. I will introduce cointegration, the Augmented Dickey–Fuller test, the Johansen test, the mathematics of half-life, and my own method for incorporating the realised distribution (skewness and kurtosis).
I will explain the principles of risk-management strategies and show practical techniques for applying this highly creative market-maker strategy.
Finally, I will touch on the core idea and mathematical approach of a cross-sectional long/short strategy.
An in-depth course for traders…
INTRODUCTION
In my most recent educational post, I explained how, over the long run, most retail traders end up with a negative expected value.
Alongside pricing, costs and taxes, one of the most important drivers of this is the random movement of prices, which materially reduces the probability of accurate forecasting. Matters are complicated further by the fact that the very probability of being able to predict price moves also fluctuates over time.
Market inefficiencies can be exploited by a trader only until they become widely known. Once they are, the edge disappears. A classic example was the January effect: toward year-end, investors and fund managers would sell their smaller-cap stocks, partly to optimise the look of their year-end reports and partly to realise losses to reduce their tax bills. That selling created pressure on small caps, which the big players then bought back after the forced sales.
As this anomaly became more widely known, more traders started snapping up the small caps being dumped onto the market; the January effect largely vanished, and brokerage costs could swallow the entire profit.
Price dynamics have several mathematical properties that sharply distinguish them from a pure random walk. These include heavy left tails and negative skewness in returns; volatility clustering; mean reversion and long memory in volatility; long-memory in order flow (stemming from order-splitting, while prices remain near-martingales because liquidity providers offset it); momentum and mean-reversion tendencies, and so on—I have written about these before.
Algorithms exploit such anomalies as well, so any edge is highly unstable. Bond-market prices, in particular, are literally unpredictable.
As I noted in my last post, there are three things we can say with confidence: 1) time passes; 2) volatility mean reverts; and 3) over the long term, equity indices are very likely to rise (though I have already shown counter-examples). This favours long-term investors and volatility sellers.
So how could one build a strategy with a positive expected value even in the long term?
In the chart below you can see the SPX’s deviation relative to its monthly average:
This is not volatility, but it is very similar, since volatility measures the standard deviation of log returns over a given window.
Yet, like volatility, it exhibits a well-defined mean-reversion property. Because of this, a misconception has taken hold among retail traders that deviations from the 21-day moving average reliably signal an overextension in the direction of market momentum—something that can be exploited with various ‘fade-the-move’ strategies.
At first glance the chart would seem to bear this out; the problem is that the moving average itself is continually moving. And that overlooks the role of time correction: the longer the market spends at a given level, the more the moving average will converge on that level. That’s high-school mathematics. Thus the moving average can move towards spot, and spot can move towards the moving average; on the chart above, the two will look identical. That gives an edge to volatility mean-reversion trades, but for spot traders it poses the same question yet again.
The problem is unchanged: the average moves—and it can move either up or down. What we would want is an ‘average’ like volatility has, something that is roughly estimable.
The problem is the uncertainty of direction. Now, spot has no such thing… but we are able to generate one ourselves…



