Pairs trading and statistical arbitrage: idea, methods, research
Pairs trading is the best-known form of statistical arbitrage: you buy one stock and simultaneously sell short a similar one when their prices have drifted unusually far apart, and you close both when the gap narrows again. The profit comes from the relative movement, not from the direction of the market. Here you will learn how to find pairs, when to enter and exit, what research says about the profits and why the strategy is riskier than its name suggests.
The idea: relative rather than absolute valuation
Whether Coca-Cola is cheap or expensive is hard to say. It is easier to ask whether Coca-Cola is cheap relative to PepsiCo: both sell similar products, depend on the same economic cycle and the same commodity prices, and their prices often move together. If they drift apart without any news, that may be a temporary mispricing. Pairs trading bets that such deviations reverse, i.e. on mean reversion, the return to the average.
You buy the relatively cheap stock and sell the relatively expensive one short (short selling). If the whole market rises or falls, the gains and losses of the two legs largely offset each other; the position is approximately market neutral. What remains is a bet on the gap. Statistical arbitrage is the umbrella term for such rules: many small, statistically grounded long/short bets, often across hundreds of stocks at the same time. It is not arbitrage in the strict sense, i.e. a risk-free profit.
A brief history
According to Gatev et al. (2006), in the mid-1980s the quant Nunzio Tartaglia assembled a team of physicists, mathematicians and computer scientists at Morgan Stanley that used statistics and automated trading to look for arbitrage in the stock market. Among other things, its programs found pairs of stocks whose prices moved together. In 1987 the group is said to have earned US$50 million this way; in 1989, after a few weak years, it was disbanded. The idea nevertheless spread among hedge funds, banks and individual traders.
Academic research came from two directions. One asked whether prices reverse in the short term: Lehmann (1990) found that a week's winners and losers reverse markedly the following week, and Jegadeesh (1990) found something similar for the monthly returns of individual stocks. The other supplied the statistics for prices that move together: the cointegration of Engle and Granger (1987). Textbooks such as Vidyamurthy (2004) turned this into a method for pairs.
Finding pairs with the distance method
The simplest method comes from the study by Gatev et al. (2006). It has two stages: pairs are selected in a formation period of twelve months and traded in the six months that follow, the trading period. The search uses no model: all prices are set to 1 at the start, and for each stock the partner is sought whose normalized price path is closest, measured by the sum of squared deviations (SSD).
SSD = Σ_t (P_A,t / P_A,0 − P_B,t / P_B,0)²; open if |gap today| > 2 × σ of formation- P_A,t / P_A,0
- price of A, normalized to the start of the formation period, with distributions reinvested
- σ of formation
- standard deviation of the gap in the formation period
Only the best pairs are traded: in the study, the top five and the top twenty with the smallest distance. If the prices diverge by more than two standard deviations, the more expensive stock is sold short and the cheaper one bought; the position is closed when the prices cross again, or at the latest at the end of the trading period.
The advantage: the method is simple, needs no model and leaves little room for overfitting. The drawback: a small gap in the past does not guarantee that the prices will stay together in future. And because very similar pairs also vary little, the deviations you bet on are often too small to leave much after costs.
Cointegration: an equilibrium between two prices
The statistically sounder question is whether two prices are cointegrated. Individual prices wander like a random walk and do not return to any mean. Following Engle and Granger (1987), two such series are called cointegrated if some combination of them is stationary, i.e. if there is a spread that keeps returning to its mean. That is more than correlation: two stocks can be highly correlated and still drift apart permanently if one grows faster on average.
ln A_t = α + β × ln B_t + u_t; z_t = (ln A_t − α − β × ln B_t) / σ_u- β
- hedge ratio: how much B is traded against one unit of A
- u_t
- spread of the pair; stationary under cointegration
- z_t
- z-score: distance from equilibrium in standard deviations σ_u
The Engle-Granger test has two steps: a regression estimates β, then an augmented Dickey-Fuller test following Said and Dickey (1984) checks whether the residuals have a unit root. Because β is estimated, stricter critical values apply; MacKinnon (1994) provided formulas for the p-values. If the spread is stationary, you trade it with fixed z-score thresholds, for example entering at ±2 and exiting close to 0.
Cointegration comes at a price. The test needs long series, and if you test many pairs, you will find some “cointegrated” ones by chance alone. This is a case of multiple testing. In addition, the hedge ratio changes over time. Many practitioners therefore estimate it on a rolling basis; Chan (2013) shows how a Kalman filter updates it day by day.
Advanced: half-life and Ornstein-Uhlenbeck
How quickly does a spread revert? The standard model is the Ornstein-Uhlenbeck process of Uhlenbeck and Ornstein (1930): the spread fluctuates randomly but is pulled back toward the mean with a force proportional to its distance from it. In daily data, this corresponds to an AR(1) regression:
Δu_t = λ × u_(t−1) + c + e_t; half-life = −ln 2 / ln(1 + λ); κ = −ln(1 + λ) × 252- λ
- negative if the spread reverts; 1 + λ is the share that remains after one day
- κ
- speed of reversion per year with 252 trading days
Elliott et al. (2005) go a step further: they model the spread as a mean-reverting process that is only observed with noise, and derive the trading decision from the model's forecast. Such time series approaches form a group of their own in the survey by Krauss (2017), alongside the distance method, cointegration, stochastic control and other methods.
From pairs to factors: Avellaneda and Lee
Instead of trading two stocks against each other, you can trade each stock against a factor. Avellaneda and Lee (2010) regress the returns of each US stock on a sector ETF or on principal components of the market. What remains, the residual, is treated as the stock-specific part. They model its cumulative sum as an Ornstein-Uhlenbeck process and measure the distance from equilibrium with the s-score. If it is below −1.25, the stock is bought and the factor sold short in the ratio β; above +1.25, the reverse. Only stocks whose residual reverts quickly are traded.
After trading costs, the strategies based on principal components achieved an average annual Sharpe ratio of 1.44 from 1997 to 2007, but only 0.9 from 2003 to 2007; the variants using sector ETFs reached 1.1 and declined similarly from 2002.
This blurs the line with rank-based long/short strategies: if you buy last month's losers each month and sell short the winners, you are also betting on reversal. Lo and MacKinlay (1990) show that such profits stem to an important extent from large stocks leading small ones. Over three to twelve months, by contrast, winners keep winning, as Jegadeesh and Titman (1993) showed (momentum).
What the research shows
The most important study is that of Gatev et al. (2006). Using daily prices from 1962 to 2002, they found excess returns of up to 11% a year for self-financing portfolios of pairs; the profits were mostly above conservatively estimated trading costs. A bootstrap with random pairs showed that the effect is not simply the well-known short-term reversal. Their interpretation:
“pairs trading profits from temporary mispricing of close substitutes”The profits were unevenly distributed over time. According to the study, pairs trading was very profitable in the 1970s and 1980s and more modest afterward. When US equities lost heavily in real terms from 1969 to 1980, the strategy did particularly well; in the strong stock market years of the mid-1990s, it marked time.
- Declining profits: Do and Faff (2010) confirm the continuing decline in profitability with more recent data. During long periods of turbulence, including the global financial crisis, however, the strategy performed strongly.
- Methods compared: Rad et al. (2016) test the distance, cointegration and copula methods on the entire US stock market from 1962 to 2014. Before costs, the excess return was 0.91%, 0.85% and 0.43% a month, after costs 0.38%, 0.33% and 0.05%. Since 2009, the distance and cointegration methods have offered opportunities much less often.
- Short-term reversal: Lehmann (1990) found reversal profits in weekly returns that survive bid-ask spreads and plausible costs, and interprets them as an inefficiency in the market for liquidity around large price moves. Jegadeesh (1990) showed that the monthly returns of individual stocks are negatively autocorrelated.
- Survey: Krauss (2017) classifies more than 100 papers into five groups and assesses their strengths and weaknesses. It is a good entry point into the literature.
All these figures come from backtests with US data and assumptions about costs and execution. They show that patterns existed, not that they will persist.
August 2007: when everyone sold at once
August 2007 showed how risky market-neutral strategies can be. Khandani and Lo (2011) simulate long/short equity portfolios based on five valuation factors and find that the “quant meltdown” began as early as July and lasted until the end of 2007. A simulated market-making strategy lost heavily in the week starting August 6 but was profitable before and after. Their explanation: a market-wide unwinding of leverage and the sudden withdrawal of market-making capital from August 8.
The mechanism is simple. Many funds held similar positions. When one had to sell, for example because of losses in entirely different markets, it pushed down the prices of its longs and drove up those of its shorts. The other funds' spreads widened, and their losses forced further sales. Market neutral therefore does not mean risk-free: the risk lies in crowding, in the question of who else holds the same positions. Avellaneda and Lee (2010) also examine their strategies during this liquidity crisis.
Risks and limitations
- Divergence: a spread that widens is both a stronger signal and a larger loss. Shleifer and Vishny (1997) show why this is dangerous: arbitrage requires capital and is risky, and with other people's money it can fail precisely when prices deviate far from fair value.
- Structural breaks: takeovers, bankruptcies, spin-offs or a new business model end a relationship for good. The statistics notice this only late; a stop-loss or a maximum holding period limits the damage.
- Short selling and borrow fees: shares sold short have to be borrowed. Engelberg et al. (2018) show that borrow fees rise and borrowed shares can be recalled. This is a risk in its own right that is reflected in prices and returns. If you are short, you also pay the dividends.
- Costs: pairs are traded frequently, and every round trip involves four orders. Spreads, fees and price concessions eat up a large part of the gross profit.
- Crowding: the more capital trades the same pairs, the smaller the deviations become and the more violent the sell-offs when everyone exits at the same time.
- Overfitting and leverage: if you test many pairs, windows and thresholds, you will always find a brilliant backtest (backtest overfitting). And because the profits per trade are small, professionals work with leverage, which also magnifies losses.
What does this mean for private investors?
For private investors, pairs trading is above all an object lesson. Many brokers allow short sales of individual stocks only to a limited extent or via derivatives, borrow fees and financing rates are higher than for professionals, and research shows declining returns since the method became widely known. What remains valuable is the insight behind it: pairs show how much of a price move is market and how much is stock-specific. And they show that market neutral does not mean risk-free. If you want to examine the idea, test it on historical prices with realistic costs and do not read the result as a forecast. This article is not investment advice.
How Portfolio Lab calculates
On the Long/Short page, you can test four methods on daily prices: pairs trading with two securities (hedge ratio via rolling OLS over 120 days or via a Kalman filter, entry at |z| above 2, exit below 0.5, stop-loss at 4), a portfolio of pairs following Gatev, Goetzmann and Rouwenhorst (12 months of formation, 6 months of trading, distance or cointegration), factor residuals following Avellaneda and Lee (60 days, s-score from ±1.25) and rank long/short by momentum, reversal or low volatility. For pairs, it shows the Engle-Granger test with its p-value and the half-life. The defaults are gross leverage of 2, costs of 0.05% of the amount traded, a borrow fee of 0.5% p.a. and trading at the next trading day's closing price. The details are in the methodology.
Frequently asked questions
What is pairs trading in simple terms?
You look for two stocks whose prices normally move together. If they drift apart, you buy the relatively cheap one and sell the relatively expensive one short. When the prices return to their usual relationship, you close both positions and keep the difference, regardless of whether the market has risen or fallen.
Does pairs trading still work today?
Research has shown declining profits for decades. Gatev, Goetzmann and Rouwenhorst found excess returns of up to 11% a year until 2002, Do and Faff confirm the decline with more recent data, and Rad, Low and Faff find only small monthly returns after costs. In crisis periods, the strategy often did better.
What is the difference between correlation and cointegration?
Correlation measures whether two returns move in the same direction on the same day. Cointegration asks whether the prices stay together over the long run, i.e. whether their spread keeps returning to a mean. Highly correlated stocks can drift apart; for pairs trading, cointegration is what counts.
Which z-score is a good entry signal?
It is common to enter at ±2 standard deviations and exit close to zero, as Gatev, Goetzmann and Rouwenhorst do. Higher thresholds produce fewer but larger trades, lower ones more trades with higher costs. There is no universally best threshold.
Is pairs trading risk-free?
No. Pairs can drift apart permanently, borrow fees rise, and borrowed shares can be recalled. In August 2007, many market-neutral funds lost money at the same time because they held similar positions. With leverage, such losses quickly become large.
What is statistical arbitrage?
The umbrella term for long/short strategies that bet on statistically estimated, temporary mispricings: in pairs, in stocks against a factor or in large portfolios. Unlike true arbitrage, it is not risk-free; it only wins on average over many trades.
Literature
- Avellaneda, Marco; Lee, Jeong-Hyun (2010): Statistical arbitrage in the US equities market. Quantitative Finance 10 (7), pp. 761–782. doi:10.1080/14697680903124632
- Chan, Ernest P. (2013): Algorithmic Trading: Winning Strategies and Their Rationale. Wiley. doi:10.1002/9781118676998
- Do, Binh; Faff, Robert (2010): Does Simple Pairs Trading Still Work?. Financial Analysts Journal 66 (4), pp. 83–95. doi:10.2469/faj.v66.n4.1
- Elliott, Robert J.; van der Hoek, John; Malcolm, William P. (2005): Pairs trading. Quantitative Finance 5 (3), pp. 271–276. doi:10.1080/14697680500149370
- Engelberg, Joseph E.; Reed, Adam V.; Ringgenberg, Matthew C. (2018): Short-Selling Risk. The Journal of Finance 73 (2), pp. 755–786. doi:10.1111/jofi.12601
- Engle, Robert F.; Granger, C. W. J. (1987): Co-Integration and Error Correction: Representation, Estimation, and Testing. Econometrica 55 (2), pp. 251–276. doi:10.2307/1913236
- Gatev, Evan; Goetzmann, William N.; Rouwenhorst, K. Geert (2006): Pairs Trading: Performance of a Relative-Value Arbitrage Rule. Review of Financial Studies 19 (3), pp. 797–827. doi:10.1093/rfs/hhj020
- Jegadeesh, Narasimhan (1990): Evidence of Predictable Behavior of Security Returns. The Journal of Finance 45 (3), pp. 881–898. doi:10.1111/j.1540-6261.1990.tb05110.x
- Jegadeesh, Narasimhan; Titman, Sheridan (1993): Returns to Buying Winners and Selling Losers: Implications for Stock Market Efficiency. The Journal of Finance 48 (1), pp. 65–91. doi:10.1111/j.1540-6261.1993.tb04702.x
- Khandani, Amir E.; Lo, Andrew W. (2011): What happened to the quants in August 2007? Evidence from factors and transactions data. Journal of Financial Markets 14 (1), pp. 1–46. doi:10.1016/j.finmar.2010.07.005
- Krauss, Christopher (2017): Statistical Arbitrage Pairs Trading Strategies: Review and Outlook. Journal of Economic Surveys 31 (2), pp. 513–545. doi:10.1111/joes.12153
- Lehmann, Bruce N. (1990): Fads, Martingales, and Market Efficiency. The Quarterly Journal of Economics 105 (1). doi:10.2307/2937816
- Lo, Andrew W.; MacKinlay, A. Craig (1990): When Are Contrarian Profits Due to Stock Market Overreaction?. Review of Financial Studies 3 (2), pp. 175–205. doi:10.1093/rfs/3.2.175
- MacKinnon, James G. (1994): Approximate Asymptotic Distribution Functions for Unit-Root and Cointegration Tests. Journal of Business & Economic Statistics 12 (2), pp. 167–176. doi:10.1080/07350015.1994.10510005
- Rad, Hossein; Low, Rand Kwong Yew; Faff, Robert (2016): The profitability of pairs trading strategies: distance, cointegration and copula methods. Quantitative Finance 16 (10), pp. 1541–1558. doi:10.1080/14697688.2016.1164337
- Said, Said E.; Dickey, David A. (1984): Testing for unit roots in autoregressive-moving average models of unknown order. Biometrika 71 (3), pp. 599–607. doi:10.1093/biomet/71.3.599
- Shleifer, Andrei; Vishny, Robert W. (1997): The Limits of Arbitrage. The Journal of Finance 52 (1), pp. 35–55. doi:10.1111/j.1540-6261.1997.tb03807.x
- Uhlenbeck, G. E.; Ornstein, L. S. (1930): On the Theory of the Brownian Motion. Physical Review 36 (5), pp. 823–841. doi:10.1103/PhysRev.36.823
- Vidyamurthy, Ganapathy (2004): Pairs Trading: Quantitative Methods and Analysis. Wiley.
This article explains a method; it is not investment or tax advice. Worked examples are simplified and rounded. All terms in the glossary.