3.1.1. Pairs Trading Modeling
Pairs trading is a trading method aimed at reducing market risk where the investor builds a portfolio consisting of just two financial products, one being of long position and the other being of short position. The pair, however, must be appropriately selected, so that a known function of the portfolio price is a stationary, mean-reverting process. One of the most popular models to account for mean-reverting processes is the Ornstein–Uhlenbeck equation (
Shreve, 2004), whose continuous time form is given by the following:
where
is a mean-reverting stochastic process (for us, it is the spread of a long–short portfolio, i.e.,
) and
,
, and
are real numbers. For simplicity reasons, we assumed that
and
were constant and that the probability distribution of
remained unchanged in certain periods.
represents the mean towards
tends, the mean-reversion parameter
—which is positive–represents the speed of such trend, and
is the multiplicative factor of the random variable
, sometimes called the volatility of the process (
Göncü & Akyildirim, 2016). Such as was used in previous research, this paper considers the stochastic process representing fat-tailed random variables (
Göncü & Akyildirim, 2016;
Yu et al., 2017;
Endres, 2020). In this way,
is called a generalized Ornstein–Uhlenbeck process or a Lévy-driven Ornstein–Uhlenbeck process.
Our pairs trading strategy defines the
spread of a long–short portfolio formed by two financial products which presents the mean-reverting property. Such as was used in existing research (
Vidyamurthy, 2004;
Zeng & Lee, 2014;
Göncü & Akyildirim, 2016), we defined the
spread as the following:
where
indicates the price of a financial product and
and
are indices of the two stocks. The weights of both stocks forming a pair are
and
, thus assuming that they are infinitely divisible. Dividends are assumed to be immediately reinvested. Although some authors (
Huck & Afawubo, 2014;
Elliott et al., 2005) prefer defining the spread by avoiding logarithms (
), or using standardized prices (
Carrasco-Blázquez et al., 2018), this paper defines the spread such as shown in Equation (2). This definition implies that the absolute return of the spread is approximately equal to the absolute return of our portfolio (see proof in
Section S.2 of the Supplementary Materials). The
coefficient has a strong impact on the mean-reversion property of the spread (an inappropriate choice may make the spread non-stationary). Notwithstanding, there is no unified criterion in the literature to assign a value to
. Among the possible methods to do so, we shall mention three widely used approaches: (i) dollar-neutrality; (ii) Vidyamurthy’s cointegration approach (which is often beta-neutral), and (iii) the Vector Error Correction Model (VECM). The most straightforward calculation is to define
dollar-neutral pairs, where the initial values of the long and short positions fully offset each other (
). If the prices (
) are divided by their initial values, then this is equivalent to setting
. Using dollar-neutral pairs is a popular approach (
Elliott et al., 2005;
Galenko et al., 2012;
Göncü & Akyildirim, 2016) because it requires little funding. However, the investor is exposed to noise because the prices at just one time (
) are used to calculate
. This can be avoided through variations of the dollar-neutral method which uses information on prices at several different times. Between them, we cite the definition of
as the slope of the ordinary least squares linear regression of
vs.
(
Huck & Afawubo, 2014). A third approach to calculating cointegration coefficients is the VECM (
Engle & Granger, 1987). Under this approach,
is computed as a two-stage least squares procedure, regressing expressions that involve both prices and returns of A and B (
Carrasco-Blázquez et al., 2018;
Nair, 2021).
A further way to calculate
is
Vidyamurthy’s cointegration approach (
Vidyamurthy, 2004). This method provides high, stable, and robust returns (alpha) (
Huck & Afawubo, 2014), also in pairs trading of cryptocurrencies. It has also been stated that returns from cointegration tend to present less extreme values (i.e., a lower Kurtosis coefficient) than other methods, like distance or copula methods (
Rad et al., 2016). Given the aforementioned advantages, this paper focuses on this approach to calculate the value of
.
Pairs trading relies on the hope that the
spread reverts to a
mean. To avoid a drift that shatters mean-reversion, the spread is defined so that it is stationary. This value of
in Equation (2) is chosen so that, even if the time series
,
are not stationary, their linear combination
is stationary. This is the definition of
cointegration: two non-stationary time series are said to be cointegrated if there is a linear combination of them that is stationary (
Vidyamurthy, 2004). Stocks prices
,
are frequently non-stationary because stock markets tend to be bullish in the long term; therefore, the choice of
is central to the profitability of pairs trading. A common way to find an appropriate value for
is from the regression of
common trends. This is based on the assumption that each of the log-prices of Equation (2) can be deconstructed into two terms: (i) a
common trend , which is non-stationary and is most often related to the evolution of markets and (ii) a
random walk term
, which is stationary and idiosyncratic (that is, it is unrelated to the general behavior of markets):
To guarantee cointegration, we needed the common trends to be proportional (
). Indeed, their proportionality constant is
(this is
), which is called the
cointegration coefficient. In the simplest case, the common trends are proportional to a single observable quantity that accounts for the market behavior (e.g., an index like the S&P 500 or the price of a share of an ETF which tracks it). Let us call
(for
) to the log-returns of the stock prices (
),
to the market returns (e.g.,
, where
is the price of the aforementioned share of an ETF that tracks the S&P 500 index), and
to a risk-free rate (e.g., the yield of the T-bills with maturity in one year).
corresponds to the returns of the indices displayed in the fourth column of the table presented in
Section S.2 of the Supplementary Materials (for the cases with one single risk factor). We can then express the returns of stocks
,
as follows:
where
are the slopes of the linear regression of
vs.
(as given by the well-known Capital Asset Pricing Model, CAPM) and
indicate returns which are specific (idiosyncratic) of the corresponding time series. Here we have considered a risk-free rate following the procedure indicated by
Do et al. (
2006), yet many authors simply assume that
. Imposing
in Equation (2) implies that the absolute returns of the spread (
) will be the following:
where the first term of the right-hand side is expected to have a low size because frequently
; this is the absolute returns of the spread lack market (non-stationary) components and will hence depend on idiosyncratic components, which are assumed to be stationary. Note that this does not mean that our portfolio is perfectly beta-neutral: When we enter our position, we are long (short) one dollar in stock
and short (long)
dollars (or other currency) in stock
. Since
is the quotient of betas, at inception our portfolio is beta-neutral; however, after the first day the values of our two positions have varied, and their quotient will most likely not remain equal to
. Hence, our portfolio will have a non-zero exposure to the market, even if the spread is perfectly beta-neutral (beta-neutral portfolios would require continuous rebalancing).
Since there is no guarantee that
,
are indeed stationary, we performed stationarity tests of the spreads (see
Table 2), and those pairs whose spreads fail to pass the test are discarded.
If we considered several risk factors instead of only one, that is, if we rely on the Arbitrage Pricing Theory (APT instead of CAPM), then Equation (4) becomes the following:
where
is the number of considered risk factors (e.g., stocks, cryptocurrencies, or commodities indexes) and
are their respective returns (see the returns of the indices displayed in the fourth column of the table presented in
Section S.2 of the Supplementary Materials). In this case,
would be the slope of the linear regression (
-vs.-
) of the cloud of points
where
and
.
Note that for simplicity’s sake we consider a constant value for the betas in Equations (4) and (6); an interesting discussion about the stationarity of the betas can be found in
Agrrawal and Clark (
2007).
In order to obtain the parameters of the Ornstein–Uhlenbeck equation (
,
, and
from Equation (1)), we performed a discretization such as indicated by
Göncü and Akyildirim (
2016). We made
and
, and we renamed
as
. Equation (1) hence becomes the following:
where
are the
residuals, being
their scaling parameter. We will later fit these residuals to different fat-tailed distributions. The ordinary least squares linear regression of
(i.e.,
) vs.
(i.e.,
) provides the
and
parameters. The residuals of the regression (
) can be fit to any probability distribution which is deemed appropriate. If the analyzed data present the appropriate properties (i.e., stationarity of the spread and low autocorrelation of residuals), then the selected pair can be traded with profit expectations. To evaluate the optimal rules for such trading, we set a maximum horizon, which is defined as the maximum number of days that a portfolio is held before selling. We then performed a Monte Carlo (MC) analysis for different values of the thresholds (trading rules) that determine the strategy. These are the following: (i) the
enter threshold, which determines the minimum absolute value of the spread to build a position (i.e., to enter the trade); (ii) the
profit-taking threshold, which determines the value of the spread to unwind (finish) the portfolio making a profit; and (iii) the
stop-loss threshold, which determines the value at which the portfolio is unwound having a loss.
The products which form the chosen long–short pairs have important features in common: they belong to the same GICS sector and to the same region, are traded in the same market with the same currency, as well as similar regulations, and both have large market capitalizations. Hence, they are expected to depend on the same economic forces. This supports the expectation that, when the spread (X in Equation (1)) moves far away from the mean (), such market forces will move it again towards this mean.