1. Introduction
Pairs trading [
1,
2] is a quantitative trading strategy based on the historical correlation of two assets that are expected to move in harmony. Thus, the idea behind it is to track two assets whose prices have historically moved together, detect when their prices diverge, and simultaneously open a short position on the winner and a long on the loser. If the observed pattern holds, it will not take long for both prices to converge again, and the trade will result in profits. By the same token, if the divergence among the prices continues, the trade will result in losses.
As shown in [
3], despite its simplicity, this strategy can generate benefits even in its most naive version, the distance method (DM). In DM, the euclidean distance on the normalized price time series is used to monitor the pair and, when the sum of the squares diverges by more than a given threshold, the long and short positions are opened. Several studies have backed up the profitability of this strategy [
4]. However, more recently, other studies have highlighted the current limitations of DM. First, its profitability has been reported to be declining over time at an increasing rate [
5,
6]. Secondly, it also presents a high risk rate, as the profitability of the strategy is immensely time-varying [
7]. Last but not least, other authors have confirmed the weak performance of DM in the US market during the first decade of the 21st century, but at the same time they have pointed out that by taking advantage of more sophisticated methodologies such as cointegration, pairs trading can still be profitable [
8]. In this line of research, several studies have proposed more sophisticated strategies for pairs trading, most of them focusing on methodologies to measure co-movement for the pair selection task. This line of study proposes ordering the universe of pairs by their co-movement and trading top pairs. In fact, there are several works proposing different methods to rank the pairs, including correlation, cointegration [
1,
9], copulas [
10,
11], or the Hurst exponent [
12,
13], and comparing them [
8,
14,
15,
16,
17]. An alternative approach to co-movement consists of combining forecasts and multi-criteria decision methods [
18,
19]. This approach, which significantly differs from the previous ones, proposes to first forecast the difference in return the stocks should have at the end of the trading period, rank them, and finally buy the top stocks of the ranking and sell the last ones.
In this paper, we aim to contribute to the understanding of pairs trading and how to build profitable strategies around this paradigm. To this end, we focus on the applicability of the Hurst exponent (
H) [
20] to identify opportunities where mean reversion (MR) happens faster. For the profitability of pairs trading, speed plays a critical role, as the short selling fees increase proportionally with the time period that the position remains open. Additionally, as several studies [
6,
21] highlight, profits are very sensitive to the associated transaction costs. We propose to use
H because it describes the chaotic properties [
22,
23] of time series, and is the most widely accepted test to measure long-term memory properties [
24,
25,
26,
27].
H is a measure for the long-term memory and fractality of a time series that quantifies the degree of persistence of similar change patterns.
H ranges between 0 and 1, and provides information on whether the series presents long-term memory or not. If
, then each step is independent of the past values of the series. Thus, there is no memory and the series is equivalent to white noise. Under this setting, the time series is unpredictable, and the Efficient Market Hypothesis (EMH) [
28,
29] is fulfilled. When
, the series is anti-persistent. In this scenario, the series is expected to display mean reversion. In terms of pairs trading, this implies that divergences within a pair will generally converge back to equilibrium. Finally, when
, the series is persistent. In a persistent regimen, the series is more likely to maintain the trend in a broader range than what is expected by pure random walk. Thus, an initial divergence among the pair will be expected to increase and drive the pair away from equilibrium. In fact, local
H has already been used to describe the chaotic properties of single financial time series and provide useful information to anticipate their trend [
30,
31].
Unlike most of the scientific literature around pairs trading, we do not rely on back-testing to test our hypothesis, but instead perform a natural experiment [
32]. As pointed out in [
33], back-testing is just a simulation of how a strategy would have performed if it had been executed over a past period of time, and therefore does not represent a proper research tool. Since we aim to find if there is a cause–effect relationship between anti-persistent values of
H and an increase in the speed to MR, we take advantage of a natural experiment that allows us to control for environmental variables.
The present paper is organized as follows: in
Section 2, we will describe the dataset, explain the methodology followed to compute several co-movement metrics, including the local Hurst exponent, and describe the design of our natural experiment. Next, in
Section 3, we present our results that show that anti-persistent values of
H reduce the time to MR. Finally, in
Section 4, we present our conclusions and discuss the importance of our results.
2. Data and Methods
2.1. Data
We built a dataset with the price time series of the top 20 cryptocurrencies in terms of market capitalization, according to CoinMarketCap as of 6 June 2024. A list of all 20 cryptocurrencies can be found in
Table A1. We downloaded this data from Binance through its API, at an hourly frequency, for the period that ranged from 1 January 2019 to 5 June 2024.
For each pair of cryptocurrencies, we computed the spread (
s) as a continuous time model given by:
where
is the natural log price of
A at timestamp
t,
is the natural log price of
B at timestamp
t, and
b is given by the following expression:
where
stands for the natural logarithmic returns of each cryptocurrency. Note that in order to compute the
we considered the preceding 30 days (720 hourly timestamps). Thus,
b represents the fraction of the 30-day volatility of cryptocurrency
A over
B. The reason behind this choice of
b is because when we buy the pair, we will short sell
b shares of
B for each share of
A that we buy. Therefore, by adopting this definition of
b, we attempt to minimize the differences in volatility between the position in cryptocurrency
A and the position in cryptocurrency
B.
2.2. The Hurst Exponent as a Mean Reversion Indicator
Regarding time-series analysis, the Hurst exponent is a widely used measure of the long-term memory of a time series. In this way,
H provides information on to what extent a time series is chaotic and unpredictable. Currently, there is a variety of methods to calculate
H, among which we have re-scaled range (RS) [
20], detrended fluctuation analysis (DFA) [
34,
35], wavelet transforms [
36], and generalized Hurst exponent (GHE) [
37].
In this work, we used GHE to measure the long-term memory of the spread of two price time series. GHE is based on the scaling behavior of the statistic:
which is given by
where
is the time scale and can vary between 1 and
,
H is the Hurst exponent, and
q represents the order of the moment considered.
H is calculated by taking logarithms in Equation (
4) for different values of
. In this work, we use
, and
, where
is the closest estimation to the classical Hurst exponent [
38]. We use
, which captures the scaling properties of the absolute deviation of time series, since we are not interested in the multi-fractal feature of GHE.
H ranges between 0 and 1. means that there is no memory; indicates that the series is anti-persistent and is expected to display MR; and indicates that the series is persistent, being more likely to maintain the trend.
To prevent using future values when computing H from the time series, we calculated a local H exponent according to a rolling window of 24, 72, 120, 168, 240, 336, 504, and 672 h, which is equivalent to 1, 3, 5, 7, 10, 14, 21, and 28 days, and that ends one hour before the measurement timestamp. By doing this, we ensured that we only used past records to obtain each value of H.
Finally, we tested whether the spread of a pair was more likely to display MR properties during anti-persistent periods (
) rather than during persistent or random periods (
). Thus, for each hour
i, we measured the time taken for the spread
s to cross to its long-term mean value
m as
where
is the minimum
j that satisfies
where
and
m represent the moving average of the spread, calculated with a rolling window of 1, 3, 5, 7, 10, 14, 21, and 28 days, matching the time window used for the calculation of
H.
2.3. Natural Experiment
In order to test if MR happens faster when
, we ran a natural experiment (or quasi-experimental design) [
32,
39,
40,
41,
42]. The goal was to compare the time that the series of a pair takes to revert to its mean value under persistent and anti-persistent or random regimes. Thus, we considered the number of hours for the spread time series to cross its long-term mean value, i.e., hours to mean reversion (
) as our response variable. Then, observations where
were assigned to the treatment group, while observations where
were assigned to the control group.
Ideally, the observations of the control group needed to be as similar as possible to the treatment group during the pre-intervention period. In our case, the intervention corresponded to the anti-persistent value of H. Thus, to satisfy this condition, each observation in the treatment group was randomly paired with a control that satisfied the following conditions:
Belonged to the same pair.
The timestamp was within a 3 to 30-day interval around the treatment timestamp. By matching observations that are not far away in time, we minimized the variability of the environmental factors surrounding the market, along with the cryptocurrencies’ properties (such as the age of the coin). In addition, we did not match observations that were less than 3 days apart because the response variable () would have been too closely related.
Had the same level of volatility at that timestamp. In particular, we averaged the 30-day volatility of the cryptocurrencies that formed the pair, and classified each observation into low, medium, or high volatility. We considered avg. volatility as low volatility and avg. volatility as high volatility. Otherwise, we classified the observation as medium volatility.
Additionally, when performing the experiments where we also controlled for the degree of co-movement, we only matched pairs classified into the same co-movement category (these categories are reported in
Table A2) at the timestamp when the trade was opened.
This matching process resulted in a final data sample of more than 8 billion control–treatment pairings.
Finally, we performed a t-test and a Wilcoxon signed-rank test to infer if there were significant differences between the means of the two groups or not and how they were related. In our data, the differences in between two sets of values were approximately normal (although they did not fit perfectly). Thus, to make the results more robust, we choose to apply both the paired t-test and Wilcoxon signed-rank test. Note that we performed these tests for the full data sample, plus separate tests also controlling for the degree of co-movement.
2.4. Pairs Trading Strategy
As stated before, pairs trading is a quantitative trading strategy based on the assumption that two assets that historically move in sync will revert to their historical relationship over time. Thus, when their prices diverge, there is a trading opportunity involving simultaneously taking a long position on the low priced asset and a short position on the high priced one. If the observed pattern holds, it will not take long for both prices to converge again and the trade will result in profit. Otherwise, the trade will result in a loss.
In this work, we used
as a trading signal to open a trade. Then, if the spread
s was between its mean value
m plus one standard deviation of
and
m plus two standard deviations of
, we sold the pair. This was equivalent to selling cryptocurrency
A and buying cryptocurrency
B, according to Equation (
1). In contrast, if the spread
s was between its mean value
m minus one standard deviation of
and
m minus two standard deviations of
, we bought the pair. This was equivalent to buying cryptocurrency
A and selling cryptocurrency
B, according to Equation (
1). These rules can be expressed mathematically as follows:
if and , sell the pair.
if and , buy the pair.
Then, the trade was closed when one of the following conditions was met:
The spread, s, of the pair reverted to its mean value.
The spread, s, of the pair deviated more than two from its mean value m.
The duration of the trade exceeded 3 days (72 h), reaching its expiration date.
One of the key points of this strategy surrounds how to select the best pairs so that the strategy results in benefits. Taking this into account, we back-tested our strategies by selecting monthly portfolios made up of the top 20 pairs according to their degree of co-movement. To do so, we ranked the pairs according to the following metrics:
Correlation. Correlation is a statistical measure that describes the extent to which two variables are linearly related. It quantifies the strength and direction of the relationship between the variables. In that sense, the higher the correlation coefficient is, the greater the variables move in sync. We used the Pearson correlation coefficient, which is the most commonly used measure of correlation.
Cointegration. The cointegration approach was introduced by Engle, and Granger [
43] and it states that two variables
X and
Y are cointegrated if there exists
such that the linear combination
is a stationary process. We used the ordinary least squares (OLS) method to estimate the regression parameters. Then, we used the Augmented Dickey–Fuller test to verify whether the residual was stationary or not, and therefore whether the stocks were cointegrated. Thus, we selected the pairs with the lower
p-values in the ADF test, since the residuals of these pairs are stationary with more probability. In contrast to correlation, which considers movements in returns and therefore is a short-term relationship, cointegration specifies co-movement of prices and it is a long-term relationship.
Dynamic time warping (DTW). DTW is an algorithm for measuring similarity between two temporal sequences, which may vary in speed. It works by identifying an optimal match between the sequences, stretching or compressing different sections of the time series. Then, the distance measure quantifies how similar the sequences are, taking into account the alignment cost computed as the sum of absolute differences for each matched pair of indices. We used a Python implementation of FastDTW [
44], which is an approximate DTW algorithm that provides optimal alignments with less time and memory complexity than DTW. The best pair will be the pair whose distance between its returns is the lowest possible, since this means that the coins move in sync and there is a high degree of co-movement between them.
Mutual Information (MI). MI is a measure of the mutual dependence between two variables. It quantifies the amount of information obtained about one variable through the other variable. In other words, it measures how much knowing one variable reduces uncertainty about the other. MI is equal to zero if and only if the two random variables are independent, and higher values mean higher dependency. For its calculation, we used the mutual_info_regression function of the Python library scikit-learn, which relies on nonparametric methods based on entropy estimation from k-nearest neighbors distances.
Additionally, we compared the results with a strategy that used a random selection of the 20 pairs for every month. This random selection was repeated 50 times to avoid any bias.
3. Results
We began by asking whether MR of the spread between pairs happens faster when the value of
H is below
(anti-persistent) or not. To this end, we conducted a natural experiment as described in
Section 2. In this experiment, the treatment represents timestamps where the considered pair satisfies
, and we repeated the experiment for several values of
. The results are summarized in
Figure 1, and full details of the experiment are given in
Table A3. We found that the effect of
was significant (
p-value
) for all the considered values of
(1, 3, 5, 7, 10, 14, 21, and 28 days), and for all cases, MR happened much faster for the treatment group compared to the control. For example, for
, the median difference between the time taken to MR between the two groups was approximately 18 h in favor of the treatment group.
Next, in search of an optimal configuration of
H, we explored the effect that the
chosen to compute the local
H had on MR. In
Figure 1 we represent the difference in
between the control and treatment groups for different values of
. On the one hand, larger differences in
between the two groups are preferable, as it can better differentiate potentially profitable trades from losses. However, on the other hand, the more observations that satisfy the anti-persistence condition (
), the more trading opportunities. Thus, we needed to find values of
that resulted in an equilibrium between both quantities. As
Figure 1 shows, the number of observations with
decreased with
, while the difference in
between the groups increased with
, reaching its maximum at
days, which represented a turning point. We identified that the region between
and
had a good balance and that one could choose
within that range according to whether one preferred more observations with
H under
, and therefore more trading opportunities, or a higher
difference between the two groups. For the remainder of the section we focus on
as it presents a difference in
between the groups very close to the maximum, while at the same time keeping a reasonable fraction of observations with
.
A widely extended pair selection method relies on measuring their co-movement and choosing the top related ones without relying on a fixed threshold. Following this line of research, we test whether the observed effect of
on
is independent of the level of co-movement between the pairs or if, on the contrary, it disappears for the top related pairs, as the effect could be already captured by the co-movement metric. To this end, we repeated the natural experiment, but this time, we also controlled by the degree of co-movement between the pairs. To measure the co-movement, we used four different metrics: correlation, cointegration, DTW, and MI. More details about the process can be found in
Section 2.
Figure 2 shows the results of the experiment separated by levels of co-movement considering different metrics: correlation (
Figure 2A), cointegration (
Figure 2B), MI (
Figure 2C), and DTW (
Figure 2D). We found that the effect was significant (see
Table A4) across all levels of co-movement for the four considered metrics. Thus, our results suggest that the effect of
on reducing the average time to MR is universal. Moreover, in general, we did not find dramatic differences across pairs with a higher or lower degree of co-movement. Nevertheless, we identified some differences that are worth mentioning. For MI, the treatment effect was slightly larger for pairs exhibiting a higher degree of co-movement. Thus, in this case, one expects that the
indicator would work better when selecting the pairs with the highest co-movement degree. By contrast, when considering cointegration as the co-movement metric, we found larger effects for the most related and non-related pairs, while the effect was reduced for intermediate values of cointegration.
To further evaluate the potential benefits of using anti-persistent values of
H as a trading signal for pairs trading, we simulated several strategies which incorporated this indicator. All these strategies were described in detail in
Section 2; however, we will summarize them below. The first of these strategies (
) consisted of selecting 20 random pairs and opening a position on each pair when the spread deviated one
from its mean and
. The operation was closed either when the spread reverted to the mean, when it deviated more than two
from it or, when the trade expired for exceeding 72 h. Next, we built five more sophisticated strategies that had the same entry and exit conditions, but with the difference that the 20 pairs were not selected randomly. Unlike the random variant of the strategy, to select the pairs in these more advanced strategies, we ordered the pairs by level of co-movement and selected the top 20. This process is updated monthly. In this way, we generated a strategy for each of the co-movement metrics. The results of the back-testing for all the six strategies are represented in
Figure 3 and
Table A5. According to our back-testing simulations, all six strategies are profitable, but the most profitable one is cointegration. Hence, our results show that
represents an informative signal for pairs trading, as it is not only associated with a faster
, but it is also capable of generating profits regardless of how the pairs are selected.
Furthermore, we evaluated the duration of the trades executed on these strategies and compared them to the duration of potential trades where
H does not satisfy the anti-persistence condition. To do this, we calculated the distribution of the duration of the trades executed for each of the strategies, which effectively reached MR. That is, we excluded the trades in which the spread diverged by more than
and trades closed due to the expiration limit. Then, in the second step, we identified all the potential trades where all the conditions to open the trade were satisfied except for
, and also computed the resulting distribution of the duration of these potential trades. Finally, we compared both distributions for all of the strategies, and the results are summarized in
Figure 4, which shows the box-plots of each group. As can be seen, the operations triggered by
were closed significantly faster than potential trades not satisfying the
condition. Moreover, once again, this result was independent of the method used to select the pairs, as the effect was significant and equally large across the five co-movement metrics. In general, the median duration of trades that reached MR was around 13 h for our strategies, and increased up to 22 h for trades not satisfying the
condition.
Finally, we explored the potential benefits that incorporating
H as an indicator has on enabling the construction of larger portfolios in pairs trading. If there are too many pairs in a trading portfolio, there is a risk that at some point there would be too many open trades simultaneously. Indeed, as in every strategy, there is usually a limited budget for trading; this translates to missed trading opportunities. Here, we studied the dependence of Maximum Simultaneous Open Trades (
) on the portfolio size for two scenarios: when
is used, and the regular case where
is not used. To this end, we simulated for each month the pairs trading strategies described above for different portfolio sizes and compared the results obtained when using
as a trigger indicator and otherwise. In this way, for each strategy, month, and portfolio size, we obtained two values of
: the first one for operations that satisfy
, and the second one for the regular case where
H is not used. The results are summarized in
Figure 5, where panels A, B, C, D, and E show the results for
H, correlation, MI, DTW, and cointegration, respectively, while panel F illustrates the difference in
between the regular case and
for each strategy. We found that the number of parallel open trades expected when using
was significantly lower, and that the difference in
between them increased proportionally to the portfolio size. In addition, we found that this effect was independent of the co-movement metric used to choose the pairs. Carrying out a deeper analysis, we observed that the difference in
between the
case and the regular case grew approximately linearly with the portfolio size for the five studied cases. In the case of the
H strategy, this relation is given by
This finding implies that when considering as a trading signal, for each additional parallel trade that the strategy budget can afford, the portfolio size could be increased by three units. For example, when limiting the number of parallel open trades to 20, the maximum portfolio size has a limit of 32 for the regular case, and increases up to 66 for . By the same token, when the limit on the number of parallel open trades is extended up to 40, the maximum portfolio size has a limit of 65 for the regular case, and increases up to 132 for .
4. Discussion
The idea behind pairs trading is to track two assets whose prices move in harmony, detect when they diverge, and simultaneously open a long position on the loser and a short on the winner betting that the series will converge back to their equilibrium. In this work, we contribute to the understanding of pairs trading strategies and their profitability by showing how H can serve as a trade alert that detects trades where MR happens faster than average. In fact, this faster MR is because MR in the short-term actually occurs much more frequently when than for other values of H. This is related to the fact that is a valid signal to indicate that a series is at that moment anti-persistent and will return to its average.
Most of the current scientific literature in this field focuses on developing and evaluating methods to measure the co-movement between the pairs in order to select a portfolio of pairs for the strategy, and test the results through back-testing. Thus, despite the fact that there have been significant advances in the methodologies used to select the pairs and their relation with the expected returns, there is still little understanding regarding which factors actually determine the success or failure of the strategies. We aim to partially fill this gap by investigating what causes MR in the cryptocurrencies market. In this respect, we propose the use of anti-persistent values of
H as an indicator. We do so because
H measures the long-term memory and fractality of a time series, and anti-persistent time series are expected to display mean reversion. To test whether the effect is significant or not, we have conducted a natural experiment that allowed us to search for a cause–effect relationship between anti-persistent values of
H and an increase in the speed of MR, while controlling for environmental variables. Our results show that for positions opened when
, MR happens faster and therefore the trade duration is shorter. Moreover, we also show that this effect persists even after controlling for the degree of co-movement of the pair. This finding suggests that re-balancing the portfolio periodically to select the top related pairs is not enough to maximize the profitability of pairs trading. Thus, the results of this paper are of interest for professional and private investors developing pairs trading strategies. As ref. [
33] points out, before designing a trading strategy, it is vital to formulate hypotheses and test them through experiments and statistical tests rather than by means of back-tests. In this respect, we have contributed to understanding what causes a faster
, and our conclusions can be used to design strategies where trading commissions are reduced due to the execution of shorter trades.
The duration of trades is a key factor in the success of pairs trading for two reasons. Firstly, in pairs trading, profits have been reported to be very sensitive to associated transaction costs, and short-selling fees increase proportionally with the time that the pair stays open. Hence, closing the operations faster can significantly reduce associated fees and prevent the strategy from failing due to associated transaction costs. Furthermore, the amount locked in the long and short positions is not available for other operations. This fact can drastically limit the number of trades that are actually executed, specially when trading with a small budget.
Another advantage is that our results represent that the design of pairs trading strategies should be related to the portfolio size. Most pairs trading strategies select a portfolio of pairs and open an operation each time a pair deviates from its mean without relying on extra information about the chances that the trade will result in profit. Alternatively, we propose the use of
H as a complementary indicator to identify opportunities where
is more probable, reducing the trades on each pair and focusing on the fastest ones. Thus, our approach allows a larger portfolio without varying the trade size. We analyzed the relation of
with the portfolio size and showed that the number of parallel open trades is reduced significantly when taking into account the value of
H. Thus, despite portfolio optimization being beyond the scope of this paper, our results represent a relevant contribution that can help private and professional traders design pairs trading strategies with larger portfolios. In fact, larger and more diversified portfolios bring important benefits related to risk reduction [
45].
Finally, we will discuss future lines of research related to the results of this paper. Our findings regarding the impact that anti-persistent values of H have on MR for pairs in the cryptocurrencies market encourages us to explore its extension to other markets. In particular, it would be of great interest to explore the stocks and Forex markets. In addition, we back-tested several strategies incorporating H as a trading signal and found that all of them were profitable between 2019 and 2024. The winner strategy consisted of selecting the pairs to trade using cointegration as the co-movement metric. However, as we already discussed, finding profits in the back-test represents no warranty, as its only role is to discard bad strategies. Hence, further research should be conducted to answer the question of whether once is used as a trading alert, it is still relevant in how to choose the portfolio of pairs.
In this paper, we focused on short-term MR rather on analyzing long-term MR, and have not analyzed whether MR is sustained or not. We did so because to build a profitable pairs trading strategy that minimizes the commission fees, it is critical that the spread returns to its mean as fast as possible, regardless of whether MR persists in time or not. However, short-term MR and long-term MR are not necessarily coupled, and understanding sustained MR represents a crucial factor for long term investors. Hence, we plan to extend the current research to explore the relationship between short-term MR and sustained MR. This will allow us to gain a deeper understanding of the effects of long-term memory on the cryptocurrency market.