# A Cooperative Dynamic Approach to Pairs Trading

Authors: J. P. Ramos-Requena; M. N. López-García; M. A. Sánchez-Granero; J. E. Trinidad-Segovia
Journal: Complexity
 (2021)

---

## Abstract

Based on recent works on stocks comovement, Pairs Trading’s strategy is enhanced by reducing the stock universe to the stocks with the lower volatility on a given date. From this universe of low volatility stocks, pairs are selected by looking for pairs whose series present a high degree of antipersistence. Finally, a “reversion to the mean” strategy is applied to these pairs. It is shown that, with this approach to Pairs Trading, positive results can be obtained for stock from the Nasdaq stock exchange, mainly during bull markets and low volatility periods.


---

## Body

## 1. Introduction

Statistical arbitrage techniques became a popular research topic after the pioneer paper of Gatev et al. [1] who proved that this methodology was able to obtain positive results in US market during a period of 30 years (1962–1997). Pairs trading strategies are structured as follows: during the formation period, two securities are identified, whose prices have moved together historically. These securities are considered in equilibrium, which is identified by a proposed model. In the second step, the trading period, the spread of their joined movement is monitored. As it is assumed that there is an equilibrium relationship between the pair, the expectation is that the spread will revert to the historical mean. Consequently, if the prices diverge, and the spread widens between the pair, the trading strategy will consist in selling short the better performing stock and purchasing the worst performing one.Researchers have proposed different methodologies and techniques. The pioneer paper of Gatev et al. [1] introduced the most popular methodology, the distance method, lately used by Do and Faff ([2, 3]). Chen et al. [4] also used this methodology but introduced the Pearson correlation on return level for identifying pairs and constructing an empirical metric to quantify return divergence of the pair.Vidyamurthy [5] introduced the cointegration approach. This approach has a higher potential of identifying true long-term equilibrium relationships between assets. Lin et al. [6] introduced a minimum profit condition for a pair of securities that is cointegrated over a time horizon. Later, Puspaningrum et al. [7] fitted an AR(1)-process to the spread of two cointegrated stocks. The authors proposed an integral equation approach to numerically evaluate the estimated number of trades for any given trading threshold or minimum profit per trade to optimize the total profit. Law et al. [8] presented an alternative implementation of the cointegration approach by introducing a statistic, which combines return maximization and risk minimization simultaneously. Clegg et al. [9] use partial cointegration as a means of identifying pairs to develop the Pairs Trading strategy, using the components of the S&P 500 over the period 1990 to 2015, where they obtain annualized returns in excess of 12% after transaction costs.Dunis and Ho [10] introduced the Multivariate Cointegration Approach. The authors used cointegration relationships to construct index tracking portfolios by considering different subsets of the index components and estimate the joint cointegration vector for these subsets and the index. Galenko et al. [11] used a multivariate cointegration framework by performing extensive data mining. The authors used different frequencies and also took different duration of the formation period to estimate the cointegration vector. Finally, the recent work of Yiyun and Law [12] proposed dynamic parameterization (ADF-threshold, adjusted ASR-threshold, and conditional cointegration coefficients) to accommodate different market conditions.Elliot et al. [13] introduced the time series approach by describing the spread with a mean-reverting Gaussian Markov chain. Do et al. [14] employed theoretical pricing methods at the return instead of the price level, and Jure and Yang [15], the stochastic control approach. Bertram [16] and Cummins et al. [17] assumed that the spread follows a zero-mean symmetric Ornstein–Uhlenbeck Process. Bock and Mestel [18] used a Markov switching model to develop a pairs trading model, Chen et al. [19] constructed a pairs trading strategy with three-regime threshold autoregressive models with GARCH effects, and Göncü and Akyildirim [20] introduced an Ornstein–Uhlenbeck process for the dispersion of the different assets.Jurek and Yang [15] did the pioneer paper where the Stochastic Control Approach is used. In this paper, the authors derived the Hamilton-Jacobi-Bellmann (HJB) equation to find closed-form solutions for the value and policy functions. Following this line, Liu and Timmermann [21] derived optimal portfolio holdings for convergence trades under diverse arbitrage opportunities. The portfolio incorporates the arbitrage opportunity and the diversification benefits. Huck [22, 23] proposed a three-stage methodology: forecasting, outranking, and trading by building and combining an artificial neural networks and a multicriteria decision method.Considering the returns negative skewness and excess kurtosis, recent contributions are based in Copula Approach. Ferreira [24], Liew and Wu [25], Stander et al. [26], Xie and Wu [27], Krauss and Stubinger [28], or Rad et al. [29] are the most representative papers of the copula methods based on parametric and nonparametric approaches. However, only Krauss and Stubinger [28] used a Copula Method for pairs selection and trading. The rest of papers used the Distance or the Cointegration approach for pairs selection.This research is based on two previous lines. The first one is the new approach introduced by Ramos-Requena et al. [30, 31] as an alternative methodology to correlation and cointegration, which is based on Hurst Exponent. The second one is based on the works of López-García et al. [32, 33] where a new measure of the assets comovement based on physical particles dynamics is introduced. The novelty of this contribution to pairs trading literature is the introduction of a preselection procedure of the stocks universe, where the pairs are selected. This preselection is based on the degree of comovement among the stocks of a specific market or index.


## 2. A New Methodology for Pairs Selection

The selection of the stocks to form a pair in a Pairs Trading strategy is one of the more crucial steps of this strategy. The main goal is to select some pairs, such that the two stocks of the pair have a high level of comovement. It is usual to measure the degree of comovement (using different tools) of two stocks and select the pairs with a higher level of comovement and we will do this, but in order to improve the selection process, we will prefilter the stock universe first.In López-García et al. ( [33]), log-price and volatility comovement is studied for stocks from the Nasdaq stock exchange. They found that stocks with low volatility tend to have a higher degree of both kinds of comovement. In fact, during noncrisis periods, the degree of comovement among stocks with low volatility is significantly higher that among random stocks.Based on these results, we propose the following selection method: in the first stage, we select the 50 stocks from our universe (stocks from the Nasdaq stock exchange) with the lower volatility at the selection date; in the second stage, we look for pairs from stocks of this 50 low volatility stocks with a high degree of comovement, based on the Hurst exponent of the pair (we look for pairs with low Hurst exponent).In López-García et al. [33], they used three comovement functions in order to measure the degree of comovement of all (or a subset of) stocks forming a given market. These functions were based on comovement studies on physical particle systems.Traditionally, the study of financial markets has been related to Brownian motion, considering the market as if it were a system of many bodies. The prices of the assets that make up the market in the short term can show identifiable patterns, but thanks to speculators who try to take advantage of this pattern, this pattern ends up being eliminated in the long term, adjusting prices to their center of mass, that is to say, to their index.Based on the Brownian motion of colloidal systems, López-García et al. ( [33]) proposed three functions to control the cooperative dynamics of financial systems. In this paper, we have used their third function:(1)C3tτ=∑i,jδxit,τδxjt,τ∑i,jδxit,τδxjt,τ,C3τ=<C3tτ>.Depending on what kind of comovement is being studied (log-price or volatility comovement),xi denotes the log-price or the volatility of stock i, and δxit,τ=xit+τ−xit for each date t and each increment τ.TheC3tτ function is a measure of the comovement (in log-price or in volatility) for stocks i and j from time origin t, averaging the product of the changes for all pairs of stocks. On the other hand C3τ is the mean of the previous measure over all time origins t, so it provides the mean comovement in a given period. Stock volatility has been calculated as the standard deviation of one-year log returns.The possible results of this functions range from −1 to 1. When values close to 0 are obtained, it means that there is no comovement. If the result is a positive number up to 1, the stocks will be moving in the same direction, so we will have a positive comovement. On the contrary, when we obtain negative results up to −1, the shares move in opposite directions, with the comovement being negative.In Figures1, 2 and 3 the comovement in different periods is shown. It is shown that the comovement in the period 2008–2013 (Figure 1) and in the period 2014–2019 (Figure 2) of the 50 stocks with lower volatility is quite high (above 0.4 in the full period). It is even higher (above 0.6) for the 2019-2020 period (Figure 3).Figure 1
Monthly comovement (C3t20) of the 50 stocks with the lower volatility each date from 2008 to 2014. Blue line is the daily comovement, while black line is a moving average of the blue line with a time window of 60 trading days.Figure 2
Monthly comovement (C3t20) of the 50 stocks with the lower volatility each date from 2014 to 2020. Blue line is the daily comovement, while black line is a moving average of the blue line with a time window of 60 trading days.Figure 3
Monthly comovement (C3t20) of the 50 stocks with the lower volatility each date from 2019 to 2021. Blue line is the daily comovement, while black line is a moving average of the blue line with a time window of 60 trading days.The study has been carried out using the period from 2008 to 2021, spread over the periods 2008–2013, 2013–2019, and 2018–2021.It is clear that the comovement of the 50 stocks with the lower volatility is quite high and well above the general market comovement, so this selection of stocks seems a good candidate to apply pairs selection methods.


## 3. Hurst Exponent

To carry out our study, we are going to apply the Hurst exponent. This exponent was introduced by the hydrologist H. E. Hurst in 1951 [34] with the main objective of studying the problem of reservoir control for the Nile river dam. Since then, it has been applied in different disciplines to study memory [35].Since its appearance, different estimation methodologies have been applied, among the most important of which are the R/S analysis [36] and the DFA [37]. But in different studies [38–41] among others, some accuracy problems were found. Then, new algorithms have been developed with the aim of estimating this indicator more efficiently.Within the financial sphere, the GHE algorithm stands out, which was defined by Barabasi in 1991 [42]. This algorithm (GHE) is based on the scaling behavior of the statistic(2)Kqτ=Xt+τ−XtqXtq,which is given by(3)Kqτ∝τqH,where τ is the scale (usually chosen between 1 and a quarter of the length of the series), H is the Hurst exponent, ⋅ denotes the sample average on time t and q is the order of the moment considered. In this paper, we will always use q=1.The GHE is calculated by linear regression, taking logarithms in the expression contained in (3) for different values of τ [43, 44].In relation to the value ofH, we can find that(i)
IfH is greater than 0.5, the process is persistent(ii)
IfH is less than 0.5, it is antipersistent(iii)
A Brownian motion hasH=0.5In this paper, we are interested in pairs with antipersistent characteristics, so we will look for pairs whose series has the lowest Hurst exponent.


## 4. Pairs Trading Strategy

Once the 50 stocks with the lowest volatility have been selected, we select the pairs from that 50-stock universe. In order to do that, we follow the method defined by Ramos-Requena et al. [31] (see also [45]). Given a pair candidate of stocks A and B, we define the pair series as sbt=pAt−bpBt, where pAt is the logarithm of the price of stock A at time t, pBt is the logarithm of the price of stock B at time t and b is the quantity invested in stock B for each dollar invested in stock A. We try to find a value of the weight factor b so that the series of the pair sb has the smallest Hurst exponent, so we try to make the series as antipersistent as possible. What we are looking for is a value of b that minimizes the function fb=Hsb, where Hsb is the Hurst exponent of the pair series sb. Then, we take the pairs with the lowest Hurst exponent of their pair series.Once we have selected the pairs with lower Hurst exponent from the universe of the 50 stocks with the lowest volatility, we finish the selection phase. The pairs trading strategy is applied through two phases. In the first phase, the selection phase, the last 250 trading days (around one year) is used to select 10, 20, or 30 pairs following the previous procedure. In the second phase, the trading phase, each selected pair is traded for the next 120 days (around six months) using the next “reversion to the mean” strategy:Lets be the pair series, m the average of the series s, and σ the standard deviation of m−s [46], then(i)
Ifm+2σ>s>m+σ, the pair will be sold at s0. The position will be closed when s<m or s>s0+σ.(ii)
Ifm−2σ<s<m−σ, the pair will be bought at s0. The position will be closed when s>m or s<s0−σ.Note that the pair is bought when stockA is bought and stock B is sold (b dollars are sold of stock B for each dollar bought of stock A). The pair is sold when stock A is sold, while stock B is bought (b dollars are bought of stock B for each dollar sold of stock A).


## 5. Empirical Results

For the empirical application, we have taken the stocks from the US Nasdaq stock exchange, for the periods 2000–2002, 2003–2007, 2007–2009, 2008–2013, 2014–2019, and 2018–2021(the data cover from 2000 to 01-01 to 2021-03-19), taking these periods coinciding with different crises (of 2 years) and bull markets (of 4-5 years).Note that previous studies, such as Ramos-Requena et al. [30], show that, in periods of high volatility, the Pairs Trading strategy is an optimal strategy.Having selected the assets with the lowest volatility as explained in section2 and applied the Pairs Trading strategy defined in section 4, we will now present the main results obtained.Table1 shows the main results obtained from this study. It shows the number of pairs in the portfolio, the number of trades to be made in the period, the average annualized return, the Sharpe ratio, and the return for the period after deducting transaction costs.Table 1
Results.
PeriodPairsOperationsAverage annual returnSharpe ratioProfits2000–200210245−3,70%−0.81−6,35%2000–200220434−4,20%−1.11−7,22%2000–200230630−3,40%−0.95−5,91%2003–2007107423,80%1.0412,86%2003–20072012663,10%1.1110,57%2003–20073016893,20%1.3611,04%2007–2009102642,60%0.414,14%2007–200920458−0,50%−0.09−1,03%2007–200930588−2,30%−0.50−4,00%2008–2013108075,90%1.6327,49%2008–20132013515,40%1.9125,32%2008–20133018084,70%1.6822,00%2014–2019109694,90%2.3822,73%2014–20192016852,00%0.608,86%2014–20193022722,60%0.8911,64%2018–202110287−2,50%−0.34−2,79%2018–2021205761,00%0.180,71%2018–2021307871,90%0.431,64%In this paper, a transaction cost of 0.01% has been taken into account, which is what an investor would have to pay in a stock market operation of these characteristics.In this case, as shown in Table1, we can observe that the strategy performs very well for a portfolio composed of 10 pairs in the period 2014 to 2019 with a Sharpe ratio of 2.38; the same is true for the portfolio composed of 20 pairs during the period 2008 to 2013.As can be seen in Table1, for most of the periods studied, the Sharpe ratio is over 1 or even above that value. It is significant that the Sharpe ratio values are close to 0 or negative in periods with large market declines, as is the case for the period 2000 to 2002, the period 2007 to 2009, and the period 2018 to 2021; as can be seen, except for the 10 pairs portfolio in the period 2007–2009 and the period 2018 to 2021, all other values are negative.If we look at average annual returns, we can see that the best results are obtained for the period 2008 to 2013 for the portfolio composed of 10 pairs with an annual return of 5.9% and the portfolio composed of 20 pairs with a return of 5.40%. As we can see for the periods 2000 to 2002 and 2007 to 2009, the returns are negative, periods in which the financial markets suffered large losses.With regard to profits after transaction costs (transaction costs have been considered 0.01%), results show that it is for the period 2008 to 2013 when the profitability of the investment is higher (27.49%, 25.32%, and 21.99%). The same occurs for the periods 2003 to 2007 and 2014 to 2019 with positive returns. However, as with the other indicators studied, it is not profitable to invest in the periods 2000 to 2002 and 2007 to 2009.Results also show that the preselection technique used can significantly improve the strategy. We will like to remark that to select portfolios with lower volatility is not a good option for applying the Pairs Trading strategy during periods of large stock market falls. In these periods, when a general Pairs Trading strategy is profitable (see, for example Ramos-Requena et al. [30]), a simple explanation is that, during prolonged bear markets, the volatilities of all stocks go up, so our selection of the 50 stocks with the lower volatility may change faster than in normal periods. Note that we update the 50 stocks with the lower volatility each 120 trading days (about half a year), and this could be too late, since the volatilities may have changed too much.Below, we show different graphs for the periods studied, showing the evolution of the cumulative logarithmic return.Figure4 shows the cumulative logarithmic return for a portfolio composed of 30 pairs for the study period 2003 to 2007. As can be seen, the graph starts in 2004, because, as explained in section 4, the selection period is 250 days, and the strategy starts from 251 days for 180 days, which is why it appears from 2004 onwards.Figure 4
Cumulative logarithmic returns for a 30-pair portfolio in the period 2003 to 2007.With respect to the cumulative logarithmic return, it can be observed that, during the 2005 financial year, there is a great growth, reaching a profitability of close to 10% in July during 2006 until the end of the study period, and it remains between 8% and 10%, to reach the maximum profitability at the end of 2007 with a profitability of more than 11%. As can be seen during this period, it is a good option to opt to follow a Pairs Trading strategy, obtaining a good profitability, as shown in Table1.Figure5 shows the cumulative logarithmic return for a portfolio composed of 30 pairs for the period 2007 to 2009. In this case, it can be seen that the return during the period is negative; it is significant that, in August 2008, the highest cumulative return of around 4% is obtained, but from that date onwards, it begins to decrease, reaching below -6% in July 2009. It can be seen that despite being a period of high volatility, in this case, the expectations of this strategy in this period are not met, and it would not be a recommendable strategy to employ.Figure 5
Cumulative logarithmic returns for a 30-pair portfolio in the period 2007 to 2009.If there was a recommended period for applying this strategy, it is for the period 2008 to 2013, as shown in Figure6. This figure shows the cumulative logarithmic return for a portfolio composed of 20 pairs. It can be seen that, until 2010, the return is negative, but it is from the beginning of 2010 until the end of 2013 that the cumulative return begins to grow, reaching a level of over 25% from 2013 onwards. Despite the high volatility dates since 2008, it is not a strategy that works as it is being developed in this paper, since despite being a market-neutral strategy, in this case, it can be observed that it is affected by movements in the financial markets.Figure 6
Cumulative logarithmic returns for a 20-pair portfolio in the period 2008 to 2013.Figure7 shows the cumulative logarithmic return for the period 2014 to 2019 for a portfolio composed of 10 pairs. It can be seen that, in this period, it is growing steadily, reaching over 20% from 2019 onwards. As in the previous period, it can be seen that this is a good investment strategy.Figure 7
Cumulative logarithmic returns for a 10-pair portfolio in the period 2014 to 2019.Finally, Figure8 shows the cumulative logarithmic return for the period 2019 to 2021; in this case, we can see an upward and downward movement during the period from March to July 2020, coinciding with the falls suffered by the stock markets caused by the restrictions taken to fight the COVID-19 pandemic. It can be seen that the highest return of more than 7% is achieved during the month of June.Figure 8
Cumulative logarithmic returns for a 30-pair portfolio in the period 2018 to 2021.As it can be seen, including this new methodology for pair selection allows us to employ the Pairs Trading strategy in periods where it was not very profitable before, thus making this strategy more attractive to investors.


## 6. Conclusions

Pairs Trading is a market-neutral statistical arbitrage strategy. Recent studies (Ramos-Requena et al. [30]) have proved that it is a profitable strategy in periods of high instability in developed markets and also in nonefficient markets (Sanchez-Granero et al. [47] and Balladares et al. [48]) such as emerging ones.One of the critical steps in Paris Trading is the pairs selection, but not too much attention has been given to the stock universe before pairs selection. In this paper, we have introduced a preselection procedure based on the stocks comovement measure through comovement functions based on comovement studies on physical particle systems. Therefore, portfolios with less volatile stocks have been selected, and it has been observed that, with this new modification, Paris Trading is also profitable in periods of low volatility.However, on high volatility conditions, the strategy does not work as good. A plausible explanation of this phenomenon could be that, during periods with prolonged downward movements in the markets, volatility of the stocks is increased, and the model proposed in this paper is too slow to capture this faster change in the volatility of the preselected stocks.



---

*Source: 7152846-2021-10-13.xml*