Research articles for the Hudson and Thames home page.

Systematic approaches of pairs trading gained popularity from the mid-1980s. Gatev et al (2006) examined the profitability of a distance-based strategy on normalized prices. Cointegration is another common strategy incorporated approach as discussed in [Vidyamurthy (2004)]. Both methods are tied to the idea of a mean-reverting bet, and the trading signals are generated from the spread: when the spread widens, it is expected to narrow, and when it does happen the trader pockets the profit.

We have previously talked about several advantages from copula-based models in Copula for Pairs Trading: A Detailed, But Practical Introduction, and as a tool it analyzes the dependence structure among several random variables (For pairs trading it is just 2 random variables). We quickly summarize it here:

ArbitrageLab is a python library filled with algorithms from the best academic journals and graduate-level textbooks, which focuses on the branch of statistical arbitrage known as pairs trading.

This playlist is a series of lecture videos that explore advanced topics and highlight how your team can compete with the world’s best hedge funds!

Whether it is for pairs trading or risk management, two natural questions to ask before putting copula for use are: How to draw samples from a copula? How should one fit a copula to data? The necessity of fitting is quite obvious, otherwise, there is no way to calibrate our model for pairs trading or risk analysis using historical data.

For sampling, it is mostly for making a Q-Q plot against the historical data as a sanity check. Note that a copula natively cannot generate future price time series since it treats time series data as independent draws from two random variables, and thus has no information regarding the sequence, which is vital in time series analysis. One way to think about sampling from a copula trained by time series is that it gives the likelihood of where the next data point is going to be, regardless of the input sequence.

Whilst backtesting architectures is a topic on its own, this article dives into how to correctly backtest a pairs trading investment strategy using a vectorized (quick methodology) rather than the more robust event-driven architecture. This is a technique that is very common amongst analysts and is rather straightforward for long-only portfolios, however, when you start to construct long-short portfolios based on statistical arbitrage, strange little nuances start to pop up.

In this post, we will investigate and showcase a machine learning selection framework that will aid traders in finding mean-reverting opportunities. This framework is based on the book: “A Machine Learning based Pairs Trading Investment Strategy” by Sarmento and Horta.

A time series is known to exhibit mean reversion when, over a certain period, it reverts to a constant mean. A topic of increasing interest involves the investigation of long-run properties of stock prices, with particular attention being paid to investigate whether stock prices can be characterized as random walks or mean-reverting processes.

Let’s Solve a Mystery.

Suppose that you encountered a promising pair of stocks that move closely together, the spread zig-zagged around 0 like some fine needle stitching that sure looks like a nice candidate for mean-reversion bets. What’s more, you find out that the two stocks’ prices for the past 2 years are all nicely normally distributed. Great! You can avoid some hairy analysis for now. Therefore you fit them as a joint-normal distribution for some sanity check and immediately find that it doesn’t look as promising anymore:

For the past two years, there were some major market events, during which the stocks moved together upwards or downwards, depending on if it was good news or bad news. Your bivariate Gaussian model, in contrast, says that such co-moves are very unlikely to happen since they are so close to the tails of the distribution and you better ignore it. What is more annoying is that the stocks tend to move downward together more than going upward, and the bivariate Gaussian distribution says it should be symmetric.

So what went wrong? For this mini example, there are two major pitfalls present:

Cointegration, a concept that helped Clive W.J. Granger win the Nobel Prize in Economics in 2003 (see Footnote 1), is a cornerstone of pairs and multi-asset trading strategies. Anecdotally, forty years have passed since Granger coined the term “cointegration” in his seminal paper “Some properties of time series data and their use in econometric model specification” (Granger, 1981), yet one still cannot find the term in Merriam-Webster, and some spell checkers will draw a wavy line without hesitation beneath its every occurrence.

Indeed, the concept of cointegration is not immediately apparent from its name. Therefore, in this article, I will attempt to answer the following questions:

The Black-Litterman (BL) model is one of the many successfully used portfolio allocation models out there. Developed by Fischer Black and Robert Litterman at Goldman Sachs, it combines Capital Asset Pricing Theory (CAPM) with Bayesian statistics and Markowitz’s modern portfolio theory (Mean-Variance Optimisation) to produce efficient estimates of the portfolio weights.

Before getting into the nitty-gritty of the algorithm it is important to understand the motivations behind developing it and why is it favored by practitioners in the industry. For a long while, investors worked under the assumption that the risk and return relationship of a portfolio was linear, meaning that if an investor wanted higher returns, they would have to take on a higher level of risk.

It’s true that the climate has changed before many times during the earth’s history based on the contents of the ice cores that were drilled from the deep ice sheets in Antarctica and Greenland. However, as Figure 1 shows – the pace of the increase and the rise in level in CO2 concentration and temperature have been dramatic (Dlugolecki and Lafled, 2005) (NOAA, 2020). The impact of the increase in temperature is being felt in melting glaciers and polar ice caps, extreme weather events and rise in sea levels. A Boston Consulting Group (BCG) survey of 3,000 people in eight countries, found that 70% of the people are now more aware (than pre-COVID-19) that human activity threatens the climate (Waddell and Beal, 2020).

Discriminating random variables on time-series on both their distribution and dependence information is motivated by the study of financial assets returns. For example, given two assets where their returns are perfectly correlated, are these returns always similar from a risk perspective? According to Kelly and Jiang (2014), the answer is no, because we did not take into account the distribution differences and distribution information. Therefore, there is a need for a distance metric that can distinguish underlying distributions of time-series even if they are perfectly correlated.