LUCA SAVIO
Quant research

Cointegration pairs trading

Complete

Engle-Granger pair selection within one sector, walk-forward re-selection, and an honest comparison against buy-and-hold — including the finding that the edge is thin and cost-sensitive.

Motivation

Pairs trading is one of the most-studied statistical arbitrage strategies and a fair test of whether a spread's mean reversion holds up once selection bias and costs are accounted for.

Data

Daily closing prices for 10 liquid large-cap US banks (JPM, BAC, WFC, C, GS, MS, USB, PNC, TFC, COF), 2015-2024, via Yahoo Finance. One sector, so any cointegration reflects shared rate/macro exposure rather than a coincidence.

Methodology

Engle-Granger two-step cointegration test on log prices, run on every pair in the universe (45 combinations) at each re-selection point. The 5 pairs with the lowest p-value below 0.05 are traded; the hedge ratio is fit by OLS on the same formation-window data. Positions are sized on the spread's z-score: enter beyond ±2.0, exit inside ±0.5, stop out beyond ±4.0.

Backtest design

Walk-forward: pairs are re-selected and the hedge ratio re-fit every 63 trading days (one quarter), using only the prior 252 days (one year) — nothing in a trading window ever influences the pair selection or hedge ratio applied to it. Positions are force-closed at the end of each quarter before re-selection. Costs are modeled explicitly: 5bps per leg per trade, plus a 30bps/year borrow cost on the short leg while a position is held — not assumed away.

Results

0.9%
CAGR (strategy)
12.5%
CAGR (buy & hold)
0.20
Sharpe (strategy)
0.55
Sharpe (buy & hold)
5.2%
Volatility (strategy)
28.8%
Volatility (buy & hold)
-9.2%
Max drawdown (strategy)
-50.2%
Max drawdown (buy & hold)
Strategy
Buy & hold benchmark
201620172018201920202021202220232024
Strategy vs Buy & hold benchmark
PointStrategyBuy & hold benchmark
20160.99840.8834
1.00660.8368
0.99910.8783
0.9940.934
0.9910.9476
0.98930.8793
0.9920.9252
0.99430.9975
0.97860.9701
0.97861.0208
0.97791.2031
0.96691.2643
20170.9591.2622
0.9621.3456
0.97411.2771
0.97091.2548
0.96361.219
0.9531.3097
0.95361.3384
0.96121.306
0.96231.3829
0.96971.4394
0.97631.4725
0.97081.5117
20180.98081.6277
0.99121.5824
0.98971.4925
0.98721.4674
0.97121.4568
0.9641.4254
0.96641.516
0.95791.529
0.94681.4636
0.93331.4226
0.94241.4289
0.92431.2247
20190.93571.3669
0.92221.3915
0.93481.342
0.94321.4884
0.92271.3463
0.95011.4513
0.9681.5173
0.9741.4097
0.97161.502
0.96681.5662
0.96931.6557
0.95871.7117
20200.95171.6222
0.95991.4123
0.94721.0146
0.94811.1592
0.94981.1878
0.99561.188
1.02821.1994
1.03241.2435
1.01361.1976
1.01011.2066
1.02031.4636
1.01151.6098
20211.00541.5935
1.01111.8627
1.00541.9778
0.99472.1092
0.99172.2415
0.97962.1526
0.96582.1297
1.00542.2519
1.00542.2411
1.00882.3608
1.00522.1953
1.00972.2086
20220.99052.2783
0.98612.1994
0.98032.0432
0.98141.8479
0.99151.9742
0.98981.7269
0.97551.8701
0.97481.8263
0.9641.652
0.97011.8504
0.97311.9754
0.98611.8135
20231.0232.0421
1.0231.9858
1.07451.6871
1.07451.7241
1.07451.6438
1.07451.7291
1.07451.8991
1.07451.7254
1.07451.6739
1.07451.6123
1.07451.8523
1.07582.1023
20241.08582.1184
1.08052.1541
1.09622.3485
1.09722.2842
1.0932.3612
1.08812.3642
1.0832.5617
1.06142.5889
1.07632.5437
1.08292.7061
1.08293.0889
1.08292.8867

Robustness checks

Entry threshold sensitivity (z = 1.5 / 2.0 / 2.5) keeps Sharpe in a 0.20-0.36 range — thin but not a knife-edge parameter choice. A 5x cost stress test flips the strategy negative (Sharpe -1.04, CAGR -5.5%), which says the edge is real but genuinely thin relative to trading frictions, not robust to them. Splitting by regime: the strategy lost money 2015-2019 (Sharpe -0.24), did well through the 2020 volatility spike (Sharpe 0.78), and was moderately positive after (Sharpe 0.33) — performance is concentrated in high-dispersion periods, not a steady year-round edge. As a leakage check, re-running the same pipeline but letting pair selection and the hedge ratio see the trading window itself (a deliberate look-ahead leak) pushes Sharpe to 1.91 — confirming the walk-forward split is doing real work, and that 0.20 is the honest number, not a bug suppressing it.

Limitations

Sharpe 0.20 is materially below the buy-and-hold benchmark's 0.55 over this window, on both an absolute and risk-adjusted basis — this strategy did not beat a naive long position here, even though its volatility (5.2%) and max drawdown (-9.2%) are far smaller than buy-and-hold's (28.8% / -50.2%). The universe is small and hand-picked (10 names, one sector), so there's real selection bias and correlated tail risk — the 2023 regional-banking stress is exactly the kind of event that hits every pair in this universe at once. Execution is modeled as same-day with flat per-trade costs; real slippage, short-borrow availability during stress, and wider bid-ask names aren't captured. Only 3 threshold values were checked, with no correction for testing multiple parameters.