Pairs Trading Strategy (Mean Reversion)
"Find two drunk guys walking home together. You don't know where they are going (Random Walk), but you know they won't get too far apart (Cointegration)."
The Concept
Pairs Trading is a market-neutral strategy. You go Long Stock A and Short Stock B.
You don't care if the market goes up or down. You only care if the Spread between them reverts to the mean.
Step 1: Finding the Pair (Cointegration)
Do not look for correlation. Look for cointegration using the Augmented Dickey-Fuller (ADF) test on the spread.
Examples: PEP vs KO, XOM vs CVX, Gold vs Gold Miners.
Step 2: Calculate the Spread
Perform a linear regression to find the hedge ratio ($\beta$).$$ P_A = \alpha + \beta P_B + \epsilon $$The spread is the residual ($\epsilon$).$$ Spread_t = P_{A,t} - \beta P_{B,t} $$
Step 3: Generate Z-Score Signals
Normalize the spread to trade based on standard deviations.$$ Z_t = \frac{Spread_t - \mu_{spread}}{\sigma_{spread}} $$
Entry Long: If Z < -2.0 (Spread makes A cheap relative to B). Buy A, Short B.
Entry Short: If Z > +2.0 (Spread makes A expensive relative to B). Short A, Buy B.
Exit: If Z reverts to 0.0.
| 1 | |
| 2 | |
| 3 | |
| 4 | |
| 5 | |
| 6 | |
| 7 | |
| 8 | |
| 9 | |
| 10 | |
| 11 | |
| 12 | |
| 13 | |
| 14 | |
| 15 | |
| 16 | |
| 17 | |
| 18 | |
| 19 | |
| 20 | |
| 21 | |
| 22 | |
| 23 | |
| 24 | |
| 25 | |
| 26 | |
| 27 | |
Risks
The Breakup (Divergence)
Sometimes the relationship breaks forever (structural change). Example: One company gets acquired, or discovers a massive oil field. The spread widens to infinity (Z-score goes to 10, 20...). You get margin called.Always use Stop Losses.