Next Article in Journal
COVID-19 Media Chatter and Macroeconomic Reflectors on Black Swan: A Spanish and Indian Stock Markets Comparison
Next Article in Special Issue
Pricing of Pseudo-Swaps Based on Pseudo-Statistics
Previous Article in Journal
Risk Mitigation in Agriculture in Support of COVID-19 Crisis Management
Previous Article in Special Issue
BeVIXed: Trading Fear in the Volatility Complex
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

A Diversification Framework for Multiple Pairs Trading Strategies

1
Department of Statistics, Purdue University, West Lafayette, IN 47906, USA
2
Department of Applied Mathematics, University of Washington, Seattle, WA 98195, USA
*
Author to whom correspondence should be addressed.
Risks 2023, 11(5), 93; https://doi.org/10.3390/risks11050093
Submission received: 3 April 2023 / Revised: 11 May 2023 / Accepted: 12 May 2023 / Published: 16 May 2023

Abstract

:
We propose a framework for constructing diversified portfolios with multiple pairs trading strategies. In our approach, several pairs of co-moving assets are traded simultaneously, and capital is dynamically allocated among different pairs based on the statistical characteristics of the historical spreads. This allows us to further consider various portfolio designs and rebalancing strategies. Working with empirical data, our experiments suggest the significant benefits of diversification within our proposed framework.

1. Introduction

Pairs trading is a widely used strategy for traders and fund managers. It involves taking simultaneous positions in two correlated assets and speculating on the path behavior of the resulting spread. While it is difficult to fully model the dynamics of a single asset, a pair of assets or securities may exhibit mean reverting behavior that can be better captured by statistical models.
Each pairs trading strategy involves three main steps: (i) identification of assets, (ii) formation of spreads, and (iii) design of trading rules. While there are various ways to select assets for pairs trading, the two price processes for each pair should exhibit an adequate degree of comovement so that the resulting spread is mean reverting. In such a case, trading opportunities arise when the spread deviates from its mean.
We adopt a statistical approach to pairs trading. For any given pair of stocks, we construct the spread such that it best fits the Ornstein–Uhlenbeck (OU) model. Specifically, we determine the optimal ratio between two stocks, along with the model parameters, such that the resulting spread time series achieves the maximum likelihood. This method is an extension of the maximum likelihood estimation (MLE) approach which typically only determines the model parameters. With the spread formed, we apply a set of trading rules. The critical levels to enter and exit are set at a multiple of the standard deviation from the long-term mean of spread. For more details, we refer to Lee and Leung (2020) and references therein.
To our best knowledge, existing studies on pairs trading analyze the performance of a single pair, rather than the aggregate performance of multiple pairs. There are several practical benefits of trading multiple pairs and considering them together in a trading program. Firstly, more spreads may give rise to more trading opportunities at any point in time. Secondly, the spreads generated from different stocks are likely to be mostly uncorrelated, which makes it an ideal setting to take advantage of diversification. Lastly, trading multiple pairs also opens up a new direction for portfolio optimization, which does not exist when trading a single pair.
In this paper, we propose a novel framework for constructing diversified portfolios from multiple pairs trading strategies. Capital is allocated among different pairs based on the statistical characteristics, such as the speed of mean reversion and volatility, of the historical spreads. Moreover, our approach is adaptive as portfolio weights are adjusted periodically. Among our allocation methods, we introduce the novel Mean Reversion Budgeting (MRB) and Mean Reversion Ranking (MRR) methods. The MRB method determines the portfolio weights based on the speeds of mean reversion, volatilities, and estimated average log-likelihood scores together. In contrast, the MRR method ranks spreads based on their estimated likelihood scores and speeds of mean reversion and assigns prespecified portfolio weights based on the rankings of the spreads.
Working with the empirical price data of six stock pairs, our experiment suggests that the proposed framework offers some desirable return profiles and portfolio features. We compare several allocation methods to the benchmark equal-weight portfolio and illustrate how dynamic rebalancing can improve portfolio performance.
The rest of the paper is organized as follows. We provide a review of related studies in Section 2. In Section 3, we outline the steps of portfolio construction and trading rules for mean reversion trading. As part of Section 4, we demonstrate how the volatility of spreads and speed of mean reversion affect the performance of simulated trades. In Section 5, we describe the proposed diversification framework. Section 6 describes the asset pairs included in our study, and our data collection process, and compares the performance of the proposed framework to the baseline. Concluding remarks are provided in Section 7.

2. Related Studies

Examples of mean-reverting spreads can be found in a number of empirical studies. They are generated from pairs of stocks and ETFs (Gatev et al. 2006; Avellaneda and Lee 2010; Montana and Triantafyllopoulos 2011; Leung and Li 2016), futures contracts (Brennan and Schwartz 1990; Dai et al. 2011), physical commodity and commodity stocks/ETFs (Kanamura et al. 2010), as well as cryptocurrencies (Leung and Nguyen 2019).
Gatev et al. (2006) provided one of the first in-depth studies on pairs trading. They proposed a commonly used Distance Method (DM) and test the CRSP stocks from 1962 to 2002. The DM method opens a position for a pair when the prices diverge from 0 by more than two historical standard deviations and closes the position at the next crossing of the prices. They reported an excess return of 1.3% for the top 5 pairs of the DM, and 1.4% for its top 20 pairs. Do and Faff (2012) examined the profitability of pairs trading accounting for transaction costs.
Other than the DM method, the cointegration test is commonly used in many alternative methods for mean reversion trading. Vidyamurthy (2004) detailed a cointegration framework for mean reversion trading based on the Engle and Granger’s error correction model representation of cointegrated series presented in Engle and Granger (1987). Galenko et al. (2012) examined an active ETF trading strategy based on cointegrated time series. Leung and Nguyen (2019) constructed cointegrated portfolios of cryptocurrencies using the Engle–Granger two-step approach and Johansen cointegration test. Huck and Afawubo (2015) compared the performance of DM and cointegration method using the components of the S&P 500 index.
Another popular approach, the stochastic spread method, captures the path behavior of the spread through a stochastic process with mean-reverting property, such as the Ornstein–Uhlenbeck (OU) process. The construction of spreads and extraction of trading signals are typically derived from the analysis of parameters of the underlying model. Elliott et al. (2005) proposed a mean-reverting Gaussian Markov chain model to describe spread dynamics. The model’s estimates are compared with observations of the spread to determine appropriate trading decisions. Do et al. (2006) further analyzed the method proposed by Elliott et al. (2005) and proposed a general stochastic residual spread method to model relative mispricing. Leung and Li (2015) studied the optimal timing strategies for mean-reverting trading under the OU process. They solved an optimal double-stopping problem to analyze the timing of entry and liquidation subject to transaction costs. Lee and Leung (2020) examined the performance of mean reversion trading using dynamically optimized entry and exit rules.
Additionally, there are methods that utilize copulas (Liew and Wu 2013; Xie et al. 2016), Principal Component Analysis (PCA) (Avellaneda and Lee 2010), and machine learning (Guijarro-Ordonez et al. 2021). In recent years, new optimization algorithms have been proposed to generate spreads with maximum in-sample mean reversion. Some of these methods can be automated to analyze a large number of stocks simultaneously (d’Aspremont 2011; Leung et al. 2020).
Finally, we note that all the studies mentioned above focus on the trading performance of a single pair. The proposed framework herein is designed for trading multiple pairs simultaneously and is optimized as a diversified portfolio.

3. Pairs Construction and Trading Rules

We construct a long-short position with two highly correlated assets S t 1 and S t 2 . The portfolio value is given by
X t = S t 1 B S t 2 ,
where the coefficient B is called the hedge ratio and can be optimized. Following the procedure detailed in Leung and Li (2016, chp. 2), we determine the optimal pair ratio through maximum likelihood estimation (MLE), whereby the resulting historical spread time series best fits the Ornstein–Uhlenbeck (OU) model.
An OU process is a mean-reverting process, described by the following stochastic differential equation:
d X t = μ ( θ X t ) d t + σ d W t ,
where μ R represents the speed of mean reversion, θ R is the long-term mean, and σ > 0 is the volatility parameter. Here, W t is a standard Brownian motion under the historical measure P .

3.1. Statistical Estimation for Optimized Mean Reversion

For any given hedge ratio b, consider the observed time series of the resulting spread X t = S t 1 b S t 2 up to time t 0 . Then, we apply the method of maximum likelihood estimation to determine the optimal parameters for the OU model based on the historical data. Specifically, given x i = X t i with time increment Δ t = t i t i 1 , define the average log-likelihood function of the past L observations as
l ( μ , θ , σ , b ) = 1 L i = t 0 L + 1 t 0 1 log f ( x i | x i 1 ; μ , θ , σ ) = 1 2 ln ( 2 π ) ln ( σ ˜ ) 1 2 L σ ˜ 2 i = t 0 L + 1 t 0 1 [ x i x i 1 e μ Δ t θ ( 1 e μ Δ t ) ] 2 ,
where
σ ˜ 2 = σ 2 1 e 2 μ Δ t 2 μ .
To express the OU parameter values that maximize the average log-likelihood in (2), we define the following:
X x = i = 1 n x i 1 ,
X y = i = 1 n x i ,
X x x = i = 1 n x i 1 2 ,
X x y = i = 1 n x i 1 x i ,
X y y = i = 1 n x i 1 2 .
In turn, the optimal parameter estimates under the OU model are given explicitly by
θ * = X y X x x X x X x y n ( X x x X x y ) ( X x 2 X x X y ) ,
μ * = 1 Δ t ln X x y θ * X x θ * X y + n ( θ * ) 2 X x x 2 θ * X x + n ( θ * ) 2 ,
( σ * ) 2 = 2 μ * n ( 1 e 2 μ * Δ t ) ( X y y 2 e 2 μ * Δ t X x y + e 2 μ * Δ t X x x 2 θ * ( 1 e μ * Δ t ) ( X y e μ * Δ t X x ) + n ( θ * ) 2 ( 1 e μ * Δ t ) 2 ) .
At this stage, we maximize the average log-likelihood function over the three OU model parameters and denote the maximized average log-likelihood by
l * ( b ) = l ( μ * , θ * , σ * , b ) .
Then, the maximized log-likelihood function l * ( b ) is further optimized over the ratio b to give the optimal hedge ratio
B = arg max b l * ( b ) .
In practice, the implementation of this optimization can be done via a grid search. For instance, suppose we limit the absolute value of the hedge ratio to be 2. Then, we compute the maximized log-likelihood function l * ( b ) for
b = { 2 , 1.99 , 1.98 , , 1.99 , 2 } .
The maximizer is denoted by B.

3.2. Trading Rules

We now describe the mechanism of the trading strategy in this study. Denote by S t 1 and S t 2 the prices of two assets at time t. Let C t be the capital available at time t. The initial investment amount is C 0 .
A number of indicators are required in order to set up the trading signals. We consider the M-day moving average of the spread X t , denoted by M A ( X t ) . Similarly, we define S D ( X t ) to be the standard deviation of the spread over the past M-days. We use the notations P O S ( X t ) and P O S ( S t 2 ) for positions of S t 1 and S t 2 . Finally, K is the trading threshold, r is the chosen risk level for the stop-loss rule, L is the length of the lookback window, and T is the length of the entire trading period.
In turn, the trading strategy is described as follows.
  • When entering trading period at time 0, use L-days historical prices of S t 1 and S t 2 to calculate the optimal pair ratio, given by
    B = arg max b l * ( b ) .
  • At each time point t, construct the spread by X t = S t 1 B S t 2 .
  • Entry rule: If the current position is zero and that X t < M A ( X t ) K S D ( X t ) , then enter a long position as follows:
    P O S ( X t ) = C t / S t 1 , C t = C t X t · P O S ( X t ) .
    If the current position is zero but X t > M A ( X t ) + K S D ( X t ) , then enter the short position:
    P O S ( X t ) = C t / S t 1 , C t = C t X t · P O S ( X t ) .
  • Exit rule: If P O S ( X t ) > 0 and X t > M A ( X t ) , then quit the long position:
    C t = C t + X t · P O S ( X t ) , P O S ( X t ) = 0 ,
    If P O S ( X t ) < 0 and X t < M A ( X t ) , then quit the short position:
    C t = C t + X t · P O S ( X t ) , P O S ( X t ) = 0 ,
  • Stop-loss rule: Let X 0 denote the value of spread at entry time. If P O S ( X t ) > 0 and X t < X 0 * ( 1 r ) , then quit the long position:
    C t = C t + X t · P O S ( X t ) , P O S ( X t ) = 0 .
    If P O S ( X t ) < 0 and X t > X 0 * ( 1 + r ) , then quit the short position:
    C t = C t + X t · P O S ( X t ) , P O S ( X t ) = 0 .
  • If there is no signal indicating entry or liquidation, then stay put:
    P O S ( X t ) = P O S ( X t ) , C t = C t .
In Step 3, a long position of X t is established if no shares of X t are held and the price of X t drops below the past M-days average value minus K times standard deviation. The number of shares purchased is determined by the ratio of current cash C t and price of S t 1 . That is, invest all the cash at hand to long S t 1 and short the corresponding S t 2 with the best pair ratio B.
As for the liquidation rule described in Step 4, the entire position is liquidated whenever the price of X t rises beyond the past M-days average value. In short, we enter the long position if the price of spread drops sufficiently far from the long-term mean, and then wait for the price to revert and take profit. The trading rule for short positions follows a similar logic. For more details on this approach, we refer to Lee and Leung (2020) and the references therein.
The trading system includes four parameters: L is the length of look-back window length that determines how many data points are used to estimate the best ratio; T determines how long we will use the estimated best ratio; M is the number of days used to calculate the moving average and standard deviation of the spread, and K is the threshold that determines the trading boundary.
Intuitively, L and M control how much past data should be incorporated in the current trading decisions. The other parameter, K, will have direct influence on the timing and frequency of trades. For instance, a smaller K will result in more frequent trading.

4. Monte Carlo Simulation

In this section, we analyze how different degrees of mean reversion may impact trading performance via Monte Carlo simulation. This analysis will shed light on capital allocation across different spreads in our diversification framework.
We begin by considering trading a single spread, whose values are simulated according to the OU model. There are three parameters in the model. The speed of mean reversion is denoted by μ , the volatility of the process is denoted by σ , and the long-term mean is θ . We generate 1000 sample paths with different combinations of parameters and simulate the trading transactions over one year ( T = 252 ) for each path by following the rule described in the previous section.
We examine the trading performance through the Sharpe ratio, average daily return, volatility, total trading numbers, and cumulative return, which are calculated based on the average over 1000 paths. The other parameters of the trading system are K = 1 and M = 30 in this experiment. Since we generate the spread time series directly, there is no need to compute the optimal pair ratio.
The results are summarized in Table 1. Among the parameters, we observe that the speed of mean reversion μ has a significant effect on the performance. Raising μ with σ and θ constant, the daily returns, Sharpe ratio, and number of trades all increase while the standard deviation decreases slightly. This is intuitive since a fast mean-reverting spread offers more trading opportunities and reduces the risk associated with the trading strategy.
Next, we examine the effect of the spread volatility σ . For different σ with μ = 30 and θ = 15 , the Sharpe ratio is almost unchanged since both daily returns and volatility increase simultaneously as σ increases. Intuitively, higher volatility may offer more trading opportunities as the spread fluctuates more rapidly. However, higher volatility also leads to a wider trading band, thus increasing the risk exposure. Lastly, the long-term mean θ does not have a significant impact on trading performance as expected, given that trades are triggered by the deviation of the spread from the long-term mean.
Based on the simulation results, the speed of mean reversion has a significantly positive effect on performance as measured by average return and Sharpe ratio. Moreover, a faster spread of mean reversion also results in more frequent trades. On the other hand, the spread volatility increases the mean and standard deviation of returns simultaneously, so the Sharpe ratio is lower for very high volatility. In contrast, the long-term mean θ does not affect the trading performance materially. Hence, we consider the mean reversion rate as a critical factor when designing the diversification framework for trading multiple pairs.

5. Diversification Framework

We consider a diversified portfolio approach to trading multiple pairs simultaneously. This leads to the analysis of a number of different methods to allocate portfolio weights to the traded pairs.
The first step is to divide the entire trading period into stages with a defined schedule for adjusting the allocation. During the first trading stage, we apply equal weights to trade all the spreads in the portfolio. After that, empirical spreads and returns are recorded and analyzed to yield an optimal allocation for the next trading stage. Moving forward, we will periodically obtain updates on the portfolio weights and re-allocate the capital for the next trading period accordingly.

5.1. Portfolio Weights

In our framework, capital is allocated across different pairs in order to form a diversified portfolio. There are various methods to determine the portfolio weights dynamically over time. To that end, we consider several methods and examine their effects on portfolio performance.

5.1.1. Mean-Variance Analysis

Inspired by Mean-Variance Analysis (MVA), one method for determining the portfolio weights is by maximizing the Sharpe ratio. For any given lookback period, let R R N be the vector of average returns of each pair and Σ R N × N be the corresponding co-variance matrix of daily returns of each pair. Then, the optimal weights are those that give the best historical in-sample Sharpe ratio. Precisely, we have
ω * = arg max ω w T R w T Σ w , s . t . w 1 = 1 .
This MVA-based method assumes that the weights that have produced the best Sharpe ratio in the recent past will lead to a good performance in the next trading period. This depends on the stability of the returns over time, which may not be a reliable assumption. To address this issue, we propose several alternative allocation methods based on the characteristics of the spreads, rather than returns.

5.1.2. Mean Reversion Budgeting

We propose an allocation method, called Mean Reversion Budgeting (MRB), which is based on the mean-reverting properties of the spreads. In essence, we seek to measure the degree of mean reversion for each spread and assign more weights to those that are considered highly mean-reverting.
The first index is the estimated maximum average log-likelihood function.
To measure the goodness of fit to an OU process for each spread, we consider the corresponding log-likelihood score. For each spread i, we denote by l ^ i the estimated maximum average log-likelihood score from the previous stage. Next, we do min-max normalization to make them all positive. Precisely, for each spread i, we define the index:
l ˜ i = l ^ i min { l ^ i } max { l ^ i } min { l ^ i } .
In addition, we consider the speed of mean reversion μ . Intuitively, a more rapidly mean-reverting spread offers more trading opportunities, so it should be allocated with more portfolio weights. In order to account for the fluctuations due to volatility, we scale the speed of mean reversion by the volatility parameter. Precisely, we write
μ ^ i r = μ ^ i σ ^ i ,
where μ ^ i and σ ^ i are, respectively, the estimated speed of mean reversion and volatility for each pair. In turn, comparing across all spreads, we define the normalized relative speed of mean reversion for spread i as
μ ˜ i = μ ^ i r min { μ ^ i r } max { μ ^ i r } min { μ ^ i r } .
Lastly, we incorporate both l ˜ i and μ ˜ i into the portfolio weight allocation. This results in the formula
w i = μ ˜ i l ˜ i i = 1 N μ ˜ i l ˜ i , i = 1 , , N .
In summary, this means that more capital is allocated into pairs that are more OU-like and mean-revert more rapidly.

5.1.3. Mean Reversion Ranking

The MRB allocation method above may sometimes lead to extreme portfolio weights. For instance, if spread i has a likelihood score l i that is significantly larger than the others, the method will allocate most of the capital to that pair based on (4), leading to portfolio concentration. Furthermore, the MRB method is susceptible to estimation errors since the portfolio weights are functions of the estimates.
These observations motivate us to propose an alternative allocation method, called Mean Reversion Ranking (MRR), which assigns fixed values based on the rankings of the product of the estimated likelihood score and speed of mean reversion. Assuming that n pairs are currently traded, we sort the n pairs in ascending order based on the product, l ˜ i and μ ˜ i , where i = 1 , , n . Then, we calculate the weights of sorted pairs by
n 1 2 n ( n 1 ) , n + 1 2 n ( n 1 ) , , 3 ( n 1 ) 2 n ( n 1 ) .
This method suggests that we allocate the fraction n 1 2 n ( n 1 ) of the capital to the pair with the lowest likelihood value and speed of mean reversion, then another fraction n + 1 2 n ( n 1 ) to the pair with the second-ranked spread, and so on.
The intuition behind this approach is as follows. If we start with equal weights 1 n , 1 n , , 1 n and then reduce by half the weight of the pair with the lowest likelihood value and speed of mean reversion, then we invest the saved capital into the pair with the highest score. This yields the fractions 1 2 n and 3 ( n 1 ) 2 n ( n 1 ) for the smallest and largest weights, respectively. The weights in the middle then increase uniformly based on their ranking indices. The ranking method offers a more moderate weight distribution than the MRB method. As our experiment shows, this method produces the highest Sharpe ratio for a given set of spreads.

5.2. Trading Rules under Diversification Framework

Next, we present all the stages within our trading framework. To start, we let { S t 11 , S t 12 , , S t N 1 , S t N 2 } be the prices of N pairs of co-moved stocks at time t. With the initial investment C 0 , we denote C t to be the total cash at time t.
For each spread, we write M A ( X t ) and S D ( X t ) to represent the moving average and standard deviation of past M-days spread, respectively. At each time t, the position of X t is given by P O S ( X t ) .
The length of the whole trading period is T and the length of lookback window is L. L R represents the window length of each small stage, also referred to as rebalancing window size. Note that the trading period is divided into T / L R small stages. Then, there are two types of transactions within the trading program: stage transition and intra-stage trading.
The complete trading procedure is described as followed:
  • Pairs ratio calculation. Entering trading period at time 0, use L-days historical prices of each pair { S t i 1 , S t i 2 } to calculate the optimal pair ratio, given by
    B i = arg max b l i * ( b ) ,
    where l i * ( · ) is the maximized average likelihood function for the i-th pair and 1 i N .
  • Spreads construction. At each time point t, construct N spreads by X t i = S t i 1 B i S t i 2 , 1 i N .
  • Stage transition. Entering a new stage, liquidate all the positions and use past L R -days trading information to update the weights ω by Equation (3), (4) or (5). Allocate the total cash at hand based on weights:
    C t i = ω i · C t .
  • Entry of intra-stage trading. Set a trading threshold K (a positive constant, e.g., 0.5, 1, or 1.25). Check the entry condition for each pair. For i { 1 , , N } , if P O S ( X t i ) = 0 and X t i < M A ( X t i ) K S D ( X t i ) , then enter the long position:
    P O S ( X t i ) = C t i / S t i 1 , C t i = C t i X t i · P O S ( X t i ) .
    If P O S ( X t i ) = 0 and X t i > M A ( X t i ) + K * S D ( X t i ) , then enter the short position:
    P O S ( X t i ) = C t i / S t i 1 , C t i = C t i X t i · P O S ( X t i ) .
  • Liquidation of intra-stage trading. Check the liquidation for each pair. For i { 1 , , N } , if P O S ( X t i ) > 0 and X t i > M A ( X t i ) , then quit the long position:
    C t i = C t i + X t i · P O S ( X t i ) , P O S ( X t i ) = 0 .
    If P O S ( X t i ) < 0 and X t i < M A ( X t i ) , then quit the short position:
    C t i = C t i + X t i · P O S ( X t i ) , P O S ( X t i ) = 0 .
  • Stop-loss rule of intra-stage trading. Set a risk level r. For i 1 , , N , let X 0 i denote the value of each spread at entry time. If P O S ( X t i ) > 0 and X t i < X 0 i * ( 1 r ) , then quit the long position:
    C t i = C t i + X t i · P O S ( X t i ) , P O S ( X t i ) = 0 .
    If P O S ( X t i ) < 0 and X t i > X 0 i * ( 1 + r ) , then quit the short position:
    C t i = C t i + X t i · P O S ( X t i ) , P O S ( X t i ) = 0 .
  • No-trade scenario. If there is no signal of entry or liquidation, then keep the positions unchanged:
    P O S ( X t i ) = P O S ( X t i ) , C t i = C t i .
  • Conduct intra-stage mean reversion trading for L R days and go back to step 3.
The entire framework can be briefly summarized as follows: (1) divide the trading period into several smaller stages; (2) when beginning a new trading stage, update the weights based on the speed of mean reversion and volatility of spreads from the previous stage; (3) liquidate all holding positions and re-allocate the total capital based on updated weights; (4) conduct mean reversion trading on each pair separately with the allocated capital until the end of this stage; (5) record the historical spreads at the end and then move onto the next stage.

6. Backtesting

In this section, we examine the performance of the proposed diversified trading framework through a backtest. Different allocation methods are implemented and their results are compared. It is worth noting that we do not apply the stop-loss rule in our experiments.

6.1. Traded Assets and Price Data

To begin, we introduce the assets used in our experiment. Six pairs of stocks are selected from six different sectors in the US market. Each pair consists of two stocks from the same industry, ranging from airlines to banking. Table 2 provides a description of the companies, along with the ticker symbols of all the pairs: WM-RSG, UAL-DAL, V-MA, MS-GS, NVDA-AMD, and CVX-XOM.
For these six pairs, we collect the daily close prices for these stocks from 1 January 2021 to 31 December 2022 using the Yahoo! Finance API.1 Figure 1 shows the price movements of each pair. Each price time series has been divided by its initial values for normalization. As we can see, the stock prices for each pair exhibit persistent comovement.
Pairs are constructed using the method detailed in Section 3 and the daily adjusted close prices from the first year. In the experiment, the subsequent year is the trading period. In each quarter, data are used to generate new trading signals. With quarterly rebalancing, we test several trading thresholds and analyze annual performance statistics.

6.2. Trading on Each Pair

To demonstrate the efficacy of the proposed mean-reversion trading strategy, we first apply the strategy to six selected pairs separately. In the formation period, we use the data from 1 January 2021 to 31 December 2021 to compute the optimal ratio for each pair. Table 3 lists the estimated best ratio and likelihood score of each pair. The parameters are selected as K = 1 , L = 252 , T = 252 , and M = 63 .
Then, we construct spreads from each pair based on the best ratio. In turn, each spread is traded in the trading period. Figure 2 illustrates separately the spread, trading positions, and returns for the six pairs in 2022. From top to bottom in each panel, we record the movement of spread X t , the position change P O S ( X t ) , and the cumulative return curve for each pair. As we can see, almost all of the pairs, except CVX-XOM, have positive annual profits, which demonstrates the effectiveness of the pairs trading strategy. As for the pair CVX-XOM, the main reason for failure is that the spreads constructed from the pairs do not display good mean reversion properties, as we can clearly observe a long-term downward trend in the spread. With this in mind, based on the spread behaviors and trading performance, it is intuitively optimal to allocate more weight to the first five pairs and less weight to CVX-XOM during the trading period. This echoes our motivation to propose a diversification framework to dynamically allocate weights on multiple pairs. It would be interesting to see whether any of the allocation methods can assign the weights accordingly.
As shown in Figure 3, the correlation coefficients between different spreads are generally small, with the most positive correlation coefficient being approximately 0.3. These low correlations suggest that there is a potential for diversification benefits in combining these spreads in a trading portfolio. By diversifying across multiple spreads, traders can potentially reduce portfolio volatility and increase the expected return. This motivates us to investigate the effectiveness of our proposed diversified trading framework.

6.3. Equal-Weight Portfolio

The baseline diversification is to trade all pairs equally, which means we implement the trading strategies for all pairs with equally allocated initial cash during the entire trading period. This equal-weight portfolio is conceptually the most straightforward way to create a diversified portfolio. It is included here to compare against nondiversified trading of single pairs and against other diversification methods.
To start, we first compare the performance of the equal-weight portfolio to the performance of every single pair in this section. The trading period is the year 2022, and the average annual and daily performance statistics of the trading strategies are presented in Table 4. We consider different trading thresholds K { 0.5 , 0.75 , 1.0 , 1.25 } . With a higher K, the spread needs to deviate further from its moving average in order to trigger a trade. The criteria presented include daily return (DailyRet), daily standard deviation (DailyStd), daily Sharpe ratio (DailySR), annual maximum drawdown (AnnMDD), and annual cumulative PnL (AnnPnL). In this experiment, we observe that the equal-weight portfolio generally outperforms single pairs in terms of daily Sharpe ratio, daily standard deviation, and annual maximum drawdown. This indicates the effectiveness of diversification for mean reversion trading.
Moreover, we observe that the standard deviations of individual pairs range from 0.4 to 1, while the standard deviation of our portfolio is lower than 0.3. This indicates that the equal-weight portfolio strategy has a lower level of risk compared to the individual pairs. This can be attributed to the diversification effect, as the portfolio strategy involves trading multiple pairs simultaneously, which helps reduce the overall risk. Therefore, our results demonstrate that an equal-weight portfolio strategy can generate a higher return and achieve a lower level of risk through diversification.

6.4. Diversification Framework

We implement multiple mean reversion trading under the diversification framework using different allocation methods, and compare the performance with the baseline equal-weight portfolio. Since the trading period is one year (1/1/2022–12/31/2022) and the rebalancing window is set to be three months, the trading period is divided into four periods. As before, trading parameters are as follows: K { 0.5 , 0.75 , 1.0 , 1.25 } , L = T = 252 days, M = 90 days.
Figure 4 displays the cumulative return curves with different allocation methods in the year 2022. Here, “MRB” stands for the Mean Reversion Budgeting method, “MRR” represents the Mean Reversion Ranking method, and “MVA” refers to the portfolio generated by the mean-variance analysis. The equal-weight portfolio serves as a baseline portfolio for comparison.
In terms of cumulative returns, the MRB method outperforms the baseline portfolio by a significant margin. On the other hand, the MRR method’s returns are only slightly higher than the baseline. This is not surprising since the rank-based method tends to spread the weights more gradually from higher to lower-ranked pairs. In other words, the MRR method does not penalize the poorly fitted spreads severely and does not assign oversized weights to the spreads with the best mean-reverting properties.
However, taking volatility into account, subsequent experiments reveal that the ranking method achieves a higher Sharpe ratio than the baseline. In contrast, the MVA portfolio lags far behind the baseline. This is perhaps intuitive since the traditional mean-variance analysis does not take into account the mean-reverting properties of the spreads.
To provide a comparative analysis of different portfolio allocation methods versus the equal-weight portfolio, we summarize the statistics of trading performance with different thresholds in Table 5. The statistics include daily returns (DailyRet), daily standard deviation (DailyStd), daily Sharpe ratio (DailySR), annual maximum drawdown (AnnMDD), and annual cumulative profit and loss (AnnPnL).
When compared to the baseline equal-weight portfolio, the MRB method significantly improves the annual return without increasing the standard deviation considerably. As a result, MRB yields a higher Sharpe ratio than the baseline portfolio. The MRR method significantly decreases volatility and also achieves a high Sharpe ratio. These observations support the notion that allocation based on mean reversion characteristics has the potential to improve portfolio performance.
Regarding the standard deviations of the differently weighted portfolios, it is notable that the MRR method exhibits the lowest standard deviation among all the portfolios, indicating that this particular combination of pairs is the least volatile. In addition, the MRB method also appears to decrease the standard deviation when compared to the equal weights and MVA methods. These findings provide further evidence for the advantages of employing a portfolio weights allocation approach to mitigate risk and enhance the overall performance of the portfolio.

6.5. MRB Portfolio Weights

In our experiment, the MRB method appears to be the best allocation method. In this section, we provide more details on how the weights vary under the MRB method during the trading period. Let us focus on the case where K = 1 . Table 6 shows the estimated parameters using the data from 1 January 2022–31 December 2022. As we can see, the NVDA-AMD and CVX-XOM pairs have the lowest likelihood scores. Table 7 shows the changes in portfolio weights for each quarter during that year. Notice that the weights for the NVDA-AMD and CVX-XOM pairs are close to zero. This is consistent with the MRB method where weights are proportional to the likelihood scores.

7. Conclusions

We have presented a trading program that dynamically allocates capital to multiple mean reversion trading strategies. The approach is designed for trading multiple pairs in order to achieve diversification effects. Moreover, the dynamic rebalancing is adaptive to the current model estimates and based on the relative performance or path behaviors of the pairs in the portfolio. Our empirical experiments have shown that, for a given set of pairs traded, the allocation method plays a significant role in the success of the diversification framework.
This paper provides portfolio managers and traders with a useful and flexible framework to test trading strategies and build portfolios involving multiple pairs. The approach discussed herein can also be applied to multiple futures spread trading that is common in other asset classes, such as interest rates, commodities, and currencies. There are plenty of examples of mean-reverting spreads between futures contracts in different markets, including Brent vs. WTI crude oil, soybean vs. soybean meal, gold vs. silver, and many more. Spread trading is very common in managed futures portfolios.
Future research directions include considering a risk-sensitive approach and incorporating additional risk controls into the trading problem. The effects on trading performance would be of practical interest. Another direction is to consider a variation of the mean-reverting model. In particular, regime-switching mean-reverting models have been used for futures trading (see Leung and Zhou 2019) and they can be suitable here for multiple spread trading.

Author Contributions

Methodology, K.L., T.L. and B.N.; software, B.N.; writing—original draft, B.N.; writing—review and editing, K.L. and T.L. All authors have read and agreed to the published version of the manuscript.

Funding

This research received no external funding.

Data Availability Statement

Not applicable.

Conflicts of Interest

The authors declare no conflict of interest.

Abbreviations

The following abbreviations are used in this manuscript:
OUOrnstein–Uhlenbeck
MLEMaximum likelihood estimation
DMDistance method
SSDSum of squared deviations
PCAPrincipal component analysis
ETFExchange traded funds
CNNConvolutional neural network
MVAMean-variance analysis

Note

1
https://pypi.org/project/yfinance/, accessed on 1 April 2023.

References

  1. Avellaneda, Marco, and Jeong-Hyun Lee. 2010. Statistical arbitrage in the us equities market. Quantitative Finance 10: 761–82. [Google Scholar] [CrossRef]
  2. Brennan, Michael J., and Eduardo S. Schwartz. 1990. Arbitrage in stock index futures. Journal of Business 63: S7–S31. [Google Scholar] [CrossRef]
  3. Dai, Min, Yifei Zhong, and Yue Kuen Kwok. 2011. Optimal arbitrage strategies on stock index futures under position limits. Journal of Futures Markets 31: 394–406. [Google Scholar] [CrossRef]
  4. d’Aspremont, Alexandre. 2011. Identifying small mean-reverting portfolios. Quantitative Finance 11: 351–64. [Google Scholar] [CrossRef]
  5. Do, Binh, and Robert Faff. 2012. Are pairs trading profits robust to trading costs? Journal of Financial Research 35: 261–87. [Google Scholar] [CrossRef]
  6. Do, Binh, Robert Faff, and Kais Hamza. 2006. A new approach to modeling and estimation for pairs trading. In Proceedings of the 2006 Financial Management Association European Conference. Stockholm: European Finance Association, vol. 1, pp. 87–99. [Google Scholar]
  7. Elliott, Robert J., John Van Der Hoek, and William P. Malcolm. 2005. Pairs trading. Quantitative Finance 5: 271–76. [Google Scholar] [CrossRef]
  8. Engle, Robert F., and Clive W. J. Granger. 1987. Co-integration and error correction: Representation, estimation, and testing. Econometrica 55: 251–76. [Google Scholar] [CrossRef]
  9. Galenko, Alexander, Elmira Popova, and Ivilina Popova. 2012. Trading in the presence of cointegration. The Journal of Alternative Investments 15: 85–97. [Google Scholar] [CrossRef]
  10. Gatev, Evan, William N. Goetzmann, and K. Geert Rouwenhorst. 2006. Pairs trading: Performance of a relative-value arbitrage rule. Review of Financial Studies 19: 797–827. [Google Scholar] [CrossRef]
  11. Guijarro-Ordonez, Jorge, Markus Pelger, and Greg Zanotti. 2021. Deep learning statistical arbitrage. arXiv arXiv:2106.04028. [Google Scholar] [CrossRef]
  12. Huck, Nicolas, and Komivi Afawubo. 2015. Pairs trading and selection methods: Is cointegration superior? Applied Economics 47: 599–613. [Google Scholar] [CrossRef]
  13. Kanamura, Takashi, Svetlozar T. Rachev, and Frank J. Fabozzi. 2010. A profit model for spread trading with an application to energy futures. The Journal of Trading 5: 48–62. [Google Scholar] [CrossRef]
  14. Lee, Donovan, and Tim Leung. 2020. On the efficacy of optimized exit rule for mean reversion trading. International Journal of Financial Engineering 7: 2050024. [Google Scholar] [CrossRef]
  15. Leung, Tim, and Hung Nguyen. 2019. Constructing cointegrated cryptocurrency portfolios for statistical arbitrage. Studies in Economics and Finance 36: 581–99. [Google Scholar] [CrossRef]
  16. Leung, Tim, and Xin Li. 2015. Optimal mean reversion trading with transaction costs and stop-loss exit. International Journal of Theoretical and Applied Finance 18: 1550020. [Google Scholar] [CrossRef]
  17. Leung, Tim, and Xin Li. 2016. Optimal Mean Reversion Trading: Mathematical Analysis and Practical Applications. Modern Trends in Financial Engineering. Hackensack: World Scientific Publishing Company. [Google Scholar]
  18. Leung, Tim, and Yang Zhou. 2019. Dynamic optimal futures portfolio in a regime-switching market framework. International Journal of Financial Engineering 6: 1950034. [Google Scholar] [CrossRef]
  19. Leung, Tim, Jize Zhang, and Aleksandr Aravkin. 2020. Sparse mean-reverting portfolios via penalized likelihood optimization. Automatica 111: 108651. [Google Scholar]
  20. Liew, Rong Qi, and Yuan Wu. 2013. Pairs trading: A copula approach. Journal of Derivatives & Hedge Funds 19: 12–30. [Google Scholar]
  21. Montana, Giovanni, and Kostas Triantafyllopoulos. 2011. Dynamic modeling of mean reverting spreads for statistical arbitrage. Computational Management Science 8: 23–49. [Google Scholar]
  22. Vidyamurthy, Ganapathy. 2004. Pairs Trading: Quantitative Methods and Analysis. Hoboken: John Wiley & Sons, vol. 217. [Google Scholar]
  23. Xie, Wenjun, Rong Qi Liew, Yuan Wu, and Xi Zou. 2016. Pairs trading with copulas. The Journal of Trading 11: 41–52. [Google Scholar] [CrossRef]
Figure 1. Normalized historical daily close prices of six pairs of stocks from 1 January 2021–31 December 2022. From top to bottom: WM-RSG, UAL-DAL, V-MA, MS-GS, NVDA-AMD, and CVX-XOM.
Figure 1. Normalized historical daily close prices of six pairs of stocks from 1 January 2021–31 December 2022. From top to bottom: WM-RSG, UAL-DAL, V-MA, MS-GS, NVDA-AMD, and CVX-XOM.
Risks 11 00093 g001
Figure 2. The separate trading performance on six pairs with K = 1 , L = 252 , T = 252 , and M = 63 in 2022. For each pair, we show the spread, position, and cumulative return over time. (a) WM-RSG. (b) UAL-DAL. (c) V-MA. (d) MS-GS. (e) NVDA-AMD. (f) CVX-XOM.
Figure 2. The separate trading performance on six pairs with K = 1 , L = 252 , T = 252 , and M = 63 in 2022. For each pair, we show the spread, position, and cumulative return over time. (a) WM-RSG. (b) UAL-DAL. (c) V-MA. (d) MS-GS. (e) NVDA-AMD. (f) CVX-XOM.
Risks 11 00093 g002
Figure 3. Correlation matrix of the constructed six spreads.
Figure 3. Correlation matrix of the constructed six spreads.
Risks 11 00093 g003
Figure 4. The accumulative returns for portfolios with different allocation methods. The trading period is the year 2022, and the parameters are: L = T = 252 , M = 90 , and L R = 63 days. Each plot corresponds to a selected trading threshold K { 0.5 , 0.75 , 1.0 , 1.25 } . (ad) K = 0.5, 0.75, 1, 1.25.
Figure 4. The accumulative returns for portfolios with different allocation methods. The trading period is the year 2022, and the parameters are: L = T = 252 , M = 90 , and L R = 63 days. Each plot corresponds to a selected trading threshold K { 0.5 , 0.75 , 1.0 , 1.25 } . (ad) K = 0.5, 0.75, 1, 1.25.
Risks 11 00093 g004
Table 1. The simulated one-year mean reversion trading performance under different configurations of OU model. The bolded numbers signify outperforming values. Parameters μ { 10 , 20 , 30 , 40 , 50 } , σ { 0.1 , 0.5 , 1.0 , 1.5 , 2.0 } , and θ is chosen from { 5 , 10 , 15 , 20 , 25 } .
Table 1. The simulated one-year mean reversion trading performance under different configurations of OU model. The bolded numbers signify outperforming values. Parameters μ { 10 , 20 , 30 , 40 , 50 } , σ { 0.1 , 0.5 , 1.0 , 1.5 , 2.0 } , and θ is chosen from { 5 , 10 , 15 , 20 , 25 } .
μ σ θ Ret (%)Std (%)SharpePnL (%)No.Trade
101.0150.01360.29510.04673.406715.410
201.0150.02290.29030.07945.852018.092
301.0150.02990.28810.10437.718420.992
401.0150.03530.28410.12489.201423.563
501.0150.04000.27970.143110.470626.018
300.1150.00290.02860.10310.738520.826
300.5150.01480.14330.10323.756620.879
301.0150.03000.28720.10487.746220.899
301.5150.04560.42950.106411.939020.922
302.0150.06000.57800.104115.709220.698
301.050.02920.27790.10517.987820.960
301.0100.02900.28210.10287.580521.055
301.0150.02950.28710.10327.616920.699
301.0200.03040.28880.10537.660620.706
301.0250.02980.28340.10527.797520.787
Table 2. The stock pairs used for testing our mean-reversion trading strategies and the description of the company.
Table 2. The stock pairs used for testing our mean-reversion trading strategies and the description of the company.
Pairs SymbolsDescription
WM-RSGWaste Management and Republic Services provide waste management and environmental services
UAL-DALUnited and Delta are two of the largest American airlines
V-MAVisa and Mastercard are two dominant players in the payment industry
MS-GSMorgan Stanley and Goldman Sachs are two large-cap stocks in the banking industry
NVDA-AMDNvidia and AMD are two American multinational semiconductor companies that develop computer processors
CVX-XOMChevron and Exxon Mobil are major companies in the energy sector
Table 3. Optimal ratio and likelihood score for each pair estimated from 1 January 2021 to 31 December 2021.
Table 3. Optimal ratio and likelihood score for each pair estimated from 1 January 2021 to 31 December 2021.
S t 1 S t 2 Optimal Ratio bLikelihood Score l
WMRSG0.985.7101
UALDAL1.025.3507
VMA0.995.8283
MSGS1.006.1103
NVDAAMD1.312.8395
CVXXOM0.954.6977
Table 4. Performance statistics of the equal-weight portfolio and trading of single pairs. The bolded numbers signify outperforming values. The parameters selected are: K { 0.5 , 0.75 , 1.0 , 1.25 } , L = T = 252 , and M = 63 .
Table 4. Performance statistics of the equal-weight portfolio and trading of single pairs. The bolded numbers signify outperforming values. The parameters selected are: K { 0.5 , 0.75 , 1.0 , 1.25 } , L = T = 252 , and M = 63 .
IndexEqual WeightWM-RSGUAL-DALV-MAMS-GSNVDA-AMDCVX-XOM
K = 0.5
DailyRet (%)0.02600.04610.07410.02660.00600.0251−0.0181
DailyStd (%)0.30200.46160.86670.58820.59351.08021.0132
DailySR0.08610.09990.08550.04520.01000.0233−0.0179
AnnMDD (%)−1.7527−4.0295−1.5036−4.7033−6.5959−3.6869−10.1602
AnnPnL (%)6.621811.969119.30846.43251.05774.9606−5.6825
K = 0.75
DailyRet (%)0.04050.03370.09960.03770.01400.0435−0.0168
DailyStd (%)0.27020.44250.80100.54800.52331.05430.9531
DailySR0.14990.07620.12440.06890.02670.0412−0.0177
AnnMDD (%)−1.0363−4.0295−1.5036−4.7033−4.7938−1.0167−9.4947
AnnPnL (%)10.59898.562627.3839.51923.21319.9788−5.2313
K = 1
DailyRet (%)0.04440.03620.10750.04420.01910.03930.0005
DailyStd (%)0.26030.44060.79620.54100.51971.06020.9026
DailySR0.17070.08230.13500.08210.03680.03710.0005
AnnMDD (%)−0.9259−4.0295−1.5036−4.7033−3.5482−0.6721−7.5687
AnnPnL (%)11.70039.257329.938111.38134.56348.82270.9027
K = 1.25
DailyRet (%)0.03390.01990.06460.01900.0240−0.01560.0336
DailyStd (%)0.23770.38160.68330.49120.48160.94370.8126
DailySR0.14280.05230.09450.03860.0499−0.01650.0413
AnnMDD (%)−2.1982−4.0295−5.3303−3.5172−2.3069−13.0758−6.6102
AnnPnL (%)8.81554.941516.91984.56245.9091−4.90657.8850
Table 5. The comparison of different portfolio allocation methods vs. the baseline (equal-weight (EW)). The bolded numbers signify outperforming values. The trading period is the year 2022, and the parameters are: L = T = 252 , M = 90 , L R = 63 days, and K { 0.5 , 0.75 , 1.0 , 1.25 } .
Table 5. The comparison of different portfolio allocation methods vs. the baseline (equal-weight (EW)). The bolded numbers signify outperforming values. The trading period is the year 2022, and the parameters are: L = T = 252 , M = 90 , L R = 63 days, and K { 0.5 , 0.75 , 1.0 , 1.25 } .
IndexEWMRBMRRMVA
K = 0.5
DailyRet (%)0.02600.04100.02890.0230
DailyStd (%)0.30200.27550.26360.3624
DailySR0.08610.14880.10970.0633
AnnMDD (%)−1.7527−1.9555−1.7722−3.5034
AnnPnL (%)6.621810.72717.43175.7548
K = 0.75
DailyRet (%)0.04050.04310.04050.0272
DailyStd (%)0.27020.24850.23490.4414
DailySR0.14990.17340.17230.0616
AnnMDD (%)−1.0363−1.9116−1.3602−3.3486
AnnPnL (%)10.598911.333310.61076.7990
K = 1
DailyRet (%)0.04440.04790.04380.0277
DailyStd (%)0.26030.26140.23100.4581
DailySR0.17070.18340.18970.0604
AnnMDD (%)−0.9259−1.9116−1.3052−3.3865
AnnPnL (%)11.700312.689011.55036.9090
K = 1.25
DailyRet (%)0.03390.03510.03280.0216
DailyStd (%)0.23770.24020.21230.2618
DailySR0.14280.14610.15430.0823
AnnMDD (%)−2.1982−2.4710−2.2249−2.5295
AnnPnL (%)8.81559.12818.51015.4669
Table 6. Parameters estimated from 1 January 2022 to 31 December 2022.
Table 6. Parameters estimated from 1 January 2022 to 31 December 2022.
S t 1 S t 2 μ σ l
WMRSG0.14150.01935.7888
UALDAL0.72840.03165.2948
VMA0.01080.01755.8850
MSGS0.03570.02445.5570
NVDAAMD2.72270.25943.1927
CVXXOM2.34610.33942.9276
Table 7. MRB portfolio weights for all six pairs over four quarters from 1 January 2022 to 31 December 2022.
Table 7. MRB portfolio weights for all six pairs over four quarters from 1 January 2022 to 31 December 2022.
S t 1 S t 2 Period 1Period 2Period 3Period 4
WMRSG0.4810.4550.2590.780
UALDAL0.1760.1610.0690.030
VMA0.0960.3090.2490.142
MSGS0.2200.0650.4220.048
NVDAAMD0.0000.0000.0000.000
CVXXOM0.0270.0100.0000.000
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content.

Share and Cite

MDPI and ACS Style

Lee, K.; Leung, T.; Ning, B. A Diversification Framework for Multiple Pairs Trading Strategies. Risks 2023, 11, 93. https://doi.org/10.3390/risks11050093

AMA Style

Lee K, Leung T, Ning B. A Diversification Framework for Multiple Pairs Trading Strategies. Risks. 2023; 11(5):93. https://doi.org/10.3390/risks11050093

Chicago/Turabian Style

Lee, Kiseop, Tim Leung, and Boming Ning. 2023. "A Diversification Framework for Multiple Pairs Trading Strategies" Risks 11, no. 5: 93. https://doi.org/10.3390/risks11050093

APA Style

Lee, K., Leung, T., & Ning, B. (2023). A Diversification Framework for Multiple Pairs Trading Strategies. Risks, 11(5), 93. https://doi.org/10.3390/risks11050093

Note that from the first issue of 2016, this journal uses article numbers instead of page numbers. See further details here.

Article Metrics

Back to TopTop