Pairs Trading & Statistical Arbitrage: A Quantitative Approach
Introduction to Pairs Trading
Pairs trading is a market-neutral strategy that involves taking simultaneously long and short positions in two historically correlated securities. The core idea is that when the price relationship between two securities deviates from its historical norm, it is likely to revert to the mean. This strategy has been studied extensively in academic literature since Gatev, Goetzmann, and Rouwenhorst's seminal 2006 paper.
As with all strategies discussed on this platform, pairs trading is presented for educational purposes. While it has shown interesting properties in historical analysis, past performance does not guarantee future results, and real-world implementation involves significant risks and complexities.
Cointegration vs Correlation
A crucial distinction in pairs trading education is between correlation and cointegration:
Correlation
Correlation measures the degree to which two securities move in the same direction. However, two highly correlated securities can drift apart permanently — correlation does not imply a stable long-run relationship.
Cointegration
Cointegration is a stronger statistical property indicating that two non-stationary time series maintain a stable linear relationship over time. In simpler terms, while each series may individually wander randomly (non-stationary), their linear combination is stationary and mean-reverting.
The Engle-Granger Methodology
The two-step Engle-Granger approach is the most common method for testing cointegration between two securities:
- Step 1 — Regression: Regress one security's price on the other to find the hedge ratio (beta). The residuals from this regression represent the spread.
- Step 2 — Stationarity test: Apply the Augmented Dickey-Fuller (ADF) test to the regression residuals. If the residuals are stationary (ADF test rejects the null hypothesis of a unit root), the pair is considered cointegrated.
The Johansen Test
The Johansen test is a more powerful alternative that can test for cointegration among multiple securities simultaneously. It uses a VAR (Vector Autoregression) framework and can identify the number of cointegrating relationships and their coefficients.
Advantages over Engle-Granger
- Can test more than two securities simultaneously
- Does not require specifying which variable is dependent
- Can identify multiple cointegrating relationships
Spread Construction and Trading
Calculating the Spread
The spread is typically calculated as: Spread = Price_A - beta * Price_B, where beta is the hedge ratio estimated from the cointegration regression. The spread should be stationary and mean-reverting if the pair is truly cointegrated.
Educational Trading Rules
- Entry: When the normalized spread (z-score) exceeds a threshold (commonly +/- 2.0 standard deviations).
- Exit: When the spread reverts to its mean (z-score approaches 0).
- Stop loss: When the spread exceeds a wider threshold (e.g., +/- 3.0), suggesting potential relationship breakdown.
Risks and Limitations
- Regime changes: Cointegrating relationships can break down due to fundamental changes in the underlying securities.
- Execution risk: Both legs must be executed simultaneously; partial fills can create unintended directional exposure.
- Short selling constraints: The short leg may face borrowing costs, recall risk, or restrictions.
- Model risk: Estimated hedge ratios change over time and may not be accurate going forward.
Disclaimer: This guide is for educational purposes only. Pairs trading and statistical arbitrage involve significant risks. Historical cointegration relationships do not guarantee future behavior.
The information contained in this report is for educational purposes only and should not be construed as investment advice. Historical backtest results are provided as statistical data and do not guarantee future performance.
Related Guides
Performance Metrics: Sharpe Ratio, Drawdown, and Beyond
Master the essential performance metrics for evaluating trading strategies. Learn about Sharpe ratio, Sortino ratio, maximum drawdown, CAGR, Calmar ratio, and profit factor — the tools every quantitative researcher needs to understand.
Machine Learning in Backtesting: Opportunities and Challenges
Explore the application of machine learning techniques to trading strategy development and backtesting. Learn about feature engineering, random forests, neural networks, and the critical pitfalls of applying ML to financial data.
Factor-Based & Multi-Factor Models: Building Systematic Portfolios
Study factor investing from the Fama-French three-factor model to modern multi-factor portfolio construction. Learn about value, momentum, quality, size, and low volatility factors and how they are used in educational research.
Volatility-Based Trading Systems: Harnessing Market Uncertainty
Explore volatility-based trading approaches including ATR-based position sizing, volatility targeting, VIX-based market timing, and GARCH modeling. Learn how volatility can be used as both a trading signal and a risk management tool.