The concept of pairs trading is pretty straightforward. As described in [Gatev et al. (2006)], we first find two stocks that have moved together historically and then monitor the spread between these stocks. If the prices of the two stocks diverge, we short the winner and go long on the loser, hoping that these prices converge in the future. If the spread is mean reverting, it will revert to its historical mean. Then, the positions are reversed and a profit can be made.

There are various frameworks that could be used to identify a pair of stocks and build pairs trading strategies. In this article, we will be discussing a couple of papers related to stochastic control based approaches, which had the highest impact in this domain. We will not be discussing pairs selection techniques here, and interested readers can refer to the Stock Selection Methods using Copula and Machine Learning for Pairs Selection articles. The objective of these methods is to identify the optimal portfolio holdings in the legs of a pairs trade compared to other available assets. Stochastic control theory is used to determine value and optimal policy functions for this portfolio problem. It does sound a bit complicated, but, I’ll try to keep things simple and explain the intuition behind how and why these methods work.

In this article we introduce a vine copula-based strategy for statistical arbitrage from [Stübinger et al., 2018] with some analysis, then we generalize their framework and suggest what can be modified. With the power of vine copula, we can directly model the relationships among multiple stocks. We want to trade based on the information generated from a vine copula model. Similar to those traditional bivariate copulae approaches in pairs trading, we will use the conditional (cumulative) probability to gauge whether a target stock is underpriced or overpriced against other stocks, and then generate trading signals based on them from a mean-reversion bet.

We aim to cover the following topics:

Quick overview of copula-based trading strategies.
Idea and typical workflow of the C-vine copula approach.
Strategy assumptions and details.
Comments and some analysis for this strategy.

Copula is a very flexible tool for modeling dependencies among random variables. Long been used in risk management, it is also a great statistical arbitrage method when coupled with a good execution rule that is not limited to just mean-reversion strategies. From 2010, multiple trading methods involving copula have been developed: from earlier simple bi-variate copula on prices series to recent sophisticated self-adaptive models using low-latency data. It is a growing and dynamic field of research and practice, however, there is little literature reviewing criteria for selecting tradable stocks dedicated solely to copula-based methods.

[Rad et al (2016)] found that the copula pairs-trading method (the version that they implemented) has much better performance in drawdown risk compared to distance and cointegration, however, bad pairs that fail to converge significantly drove down its performance. It is a serious reminder to practitioners that building a suitable portfolio is just (if not more) as important as applying a great trading method, and a less desirable set of securities can quickly ruin a seemingly great strategy. The Vine copula is created to model across multiple random variables and therefore poses a greater challenge in selecting stocks.

Copula is a great statistical tool to study the relation among multiple random variables: By focusing on the joint cumulative density of quantiles of marginals, we can bypass the idiosyncratic features of marginal distributions and directly look at how they are “related”.

Indeed, traders and analysts have been using copula to exploit statistical arbitrage under the pairs trading framework for some time, and we have implemented some of the most popular methods in ArbitrageLab. However, it is natural to expand beyond dealing with just a pair of stocks: There already exist a great amount of competing stat arb methods alongside copula, thinning the potential alpha. It is also intuitive for humans to think about relative pricing among 2 stocks, whereas for higher dimensions it is not so easy, and left great opportunities for quantitative approaches.

Born at Morgan Stanley in the late 1980s, under the wing of Nunzio Tartaglia and his team, who later split up to start several of the world’s best hedge funds, namely PDT Partners and D.E. Shaw (which then lead to Two Sigma). Pairs trading has proven to be a popular and sophisticated trading strategy, often taught in advanced MSc Financial Engineering programs.

It is time to get down to the nitty-gritty of the implementation of a mean-reversion strategy.

The crux of implementing a mean-reversion trading strategy is to pinpoint the trade location. Apparently, we want to initiate a trade when the spread value has deviated considerably from its long-term mean. However, “a considerable deviation” is a rather vague description and needs to be quantified when it comes to trade execution. For the sake of convenience and clarity, I will use “boundary” to refer to the trade location and “spread” to both the spread of the long-short asset pairs and the value of the multi-asset portfolio in the remainder of this article.

“Buy low, sell high.” One cannot find a more succinct summary of a mean-reversion trading strategy; however, single assets that show stable mean-reversion over a significant period of time such that a mean-reversion trading strategy can readily become profitable are rare to find in markets today. Even if such gems were found, celebrating the discovery of the gateway to easy money could prove premature:

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:

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.