Cointegration is a recognized technique that mathematically expresses the basic idea of pair trading.
Method
Time series {X(t),Y(t)} form a cointegrated pair if there exists a stationary process R(t) that is a linear combination of X(t) and Y(t):
R(t) = Y(t) - aX(t) - b, <R(t)>=0 ,
where <...> stands for averaging over time. It should be noted that cointegration of {X(t),Y(t)} is meaningful - therefore {X(t),Y(t)} pair is tradable - only when cointegration of {X(t),Y(t)} is not an artificial phenomenon caused by a spurious correlation but is the consequence of a casual relationship. The cointegration method is as follows:
R(t) = Y(t) - aX(t) - b, <R(t)>=0 ,
where <...> stands for averaging over time. It should be noted that cointegration of {X(t),Y(t)} is meaningful - therefore {X(t),Y(t)} pair is tradable - only when cointegration of {X(t),Y(t)} is not an artificial phenomenon caused by a spurious correlation but is the consequence of a casual relationship. The cointegration method is as follows:
- Calculate a and b using the ordinary least square (OLS) regression method;
- Generate R(t) = Y(t) - aX(t) - b time series;
- Check that R(t) is a stationary process;
- Calculate the standard deviation, S(t), of R(t);
- Generate trade signals using Z-score Z(t) = R(t) / S(t).
Let us consider the time series produced by the daily closing price of PepsiCO, Inc. and The Coca-Cola companies in between 5/01/18 and 9/30/18.
Figure 1 The linear regression of the daily closing price of PepsiCO, Inc. and The Coca-Cola companies between 5/01/18 and 9/30/18 obtained by the OLS method.
The calculated linear regression,
R(t) = PEP(t) - 3.8 KO(t) - 61.3,
is shown in Figure 1. The regression r squared is 0.87. The calculated standard deviation of R(t) is ~ 2.3.
Figure 2 The residual time series, R(t), generated from PepsiCO, Inc. and The Coca-Cola stock price series.
The time dependence of the residual series, R(t), is shown in Figure 2. When R(t) is below zero a trader accumulates PEP and simultaneously sells KO shares, e. g. buy 10 shares of PEP and sell 38 shares of KO. When R(t) is above zero, the trader sells PEP and buys KO using the same ratio.
Cointegration looks for a stationary relationship between two different investment assets. Except for spurious correlation, this is possible only when these assets have the same return on investment (ROI). Typically, the pairs selected by the cointegration method work fine in backtesting. However, the calculated parameters a and b often break down when forward testing/trading is carried out. The reason for such a break is that in reality there are no ROI-identical companies. For example, General Motors went bankrupt in the recession of 2008 while Ford managed to survive. There is no way to predict such a fundamental divergence using only statistical analysis of the historical price data. Large funds have a chance to mitigate this problem by running a diversified portfolio of pairs.
A retail trader, on the other side, should select pairs made of index ETFs/futures, currency ETFs/futures, and commodity ETF/futures where the long-term relationship between the assets is of a general nature while the diversification is achieved by the very design of a trading vehicle. Besides, R(t) has to be treated as a nonstationary process. In this case, the main goal of a pair selection method is to find out R(t) that is characterized by a weak time dependence relative to that of the components of the pair.
Figure 1 The linear regression of the daily closing price of PepsiCO, Inc. and The Coca-Cola companies between 5/01/18 and 9/30/18 obtained by the OLS method.
The calculated linear regression,
R(t) = PEP(t) - 3.8 KO(t) - 61.3,
is shown in Figure 1. The regression r squared is 0.87. The calculated standard deviation of R(t) is ~ 2.3.
Figure 2 The residual time series, R(t), generated from PepsiCO, Inc. and The Coca-Cola stock price series.
The time dependence of the residual series, R(t), is shown in Figure 2. When R(t) is below zero a trader accumulates PEP and simultaneously sells KO shares, e. g. buy 10 shares of PEP and sell 38 shares of KO. When R(t) is above zero, the trader sells PEP and buys KO using the same ratio.
Discussion
A retail trader, on the other side, should select pairs made of index ETFs/futures, currency ETFs/futures, and commodity ETF/futures where the long-term relationship between the assets is of a general nature while the diversification is achieved by the very design of a trading vehicle. Besides, R(t) has to be treated as a nonstationary process. In this case, the main goal of a pair selection method is to find out R(t) that is characterized by a weak time dependence relative to that of the components of the pair.
A practical example of pair trading suitable for a retail trader is given in "Correlation: Statistical Arbitrage of the Russell 2000 - Nasdaq 100".
No comments:
Post a Comment