Pairs Trading Signal and Position Sizing via Cointegration

Finance · Hard · Free problem

Two stocks $A$ and $B$ have log prices that are individually $I(1)$ (unit root), but the spread $Y_t = \ln P_t^A - \beta \ln P_t^B$ is stationary -- they are cointegrated. You have estimated the following from historical data:

  • Hedge ratio: $\beta = 1.2$
  • Long-run spread mean: $\mu = 0.05$
  • Spread standard deviation: $\sigma = 0.02$
  • Half-life of mean reversion: $h = 10$ days
  • Current spread: $Y_t = 0.09$

The spread follows an Ornstein-Uhlenbeck process $dY_t = \kappa(\mu - Y_t)\,dt + \sigma_Y\,dW_t$.

  1. Compute the z-score of the current spread and interpret the trading signal.
  1. Describe the exact positions you would take (which stock to go long, which to short, and in what ratio).
  1. Determine the mean-reversion speed $\kappa$ from the half-life, estimate the expected profit per unit of spread, and discuss how you would size the position and manage risk.

Hints

  1. Start by computing how many standard deviations the current spread is from its long-run mean -- that gives you the signal strength.
  2. The half-life of mean reversion determines $\kappa$ via $h = \ln 2 / \kappa$. Use the OU expected path $E[Y_{t+s}] = \mu + (Y_t - \mu)e^{-\kappa s}$ to estimate how quickly profit accrues.
  3. Since $Y_t$ is above $\mu$, stock $A$ is relatively overpriced. Short $A$ and go long $\beta$ units of $B$. Size the position so that a further spread blowout (e.g., $z = 3$) hits your risk limit, not your ruin point.

Worked Solution

How to Think About It: Cointegration means the spread between these two stocks is like a rubber band -- it can stretch, but it snaps back. The individual stocks can wander anywhere (they are unit root processes), but their linear combination is stationary. That is the entire edge: you are not betting on which direction either stock goes, you are betting that the spread, which is currently stretched, will contract back to its historical mean. The first thing any trader does is compute the z-score to see how far the spread has deviated. Then you figure out which side to be on and how big to go.

Key Insight: You are trading the spread, not the individual stocks. The hedge ratio $\beta$ tells you how to construct the spread so that your position is market-neutral with respect to the common stochastic trend.

The Method:

*Step 1 -- Compute the z-score:*

$z = \frac{Y_t - \mu}{\sigma} = \frac{0.09 - 0.05}{0.02} = 2.0$

The spread is 2 standard deviations above its mean. This is a strong signal that the spread is rich and will revert downward.

*Step 2 -- Determine the trade direction:*

Since $Y_t = \ln P_t^A - 1.2 \ln P_t^B$ is too high, stock $A$ is overpriced relative to stock $B$ (after adjusting by $\beta$). You want to sell the spread:

  • Short stock $A$
  • Long $\beta = 1.2$ units of stock $B$ for every 1 unit of $A$ shorted

This is dollar-neutral in the spread -- the cointegrating relationship ensures the position is hedged against the common trend.

*Step 3 -- Extract the mean-reversion speed:*

The half-life formula for an OU process is $h = \ln 2 / \kappa$, so:

$\kappa = \frac{\ln 2}{h} = \frac{0.693}{10} \approx 0.0693 \text{ per day}$

*Step 4 -- Estimate expected profit:*

The spread is expected to revert from $Y_t = 0.09$ toward $\mu = 0.05$. The expected path of the spread is:

$E[Y_{t+s}] = \mu + (Y_t - \mu)e^{-\kappa s}$

After one half-life (10 days), the deviation halves: the spread moves from $0.09$ to roughly $0.05 + 0.04 \times 0.5 = 0.07$. After two half-lives (20 days), it reaches about $0.06$. The full expected convergence captures roughly $0.04$ in log-price terms per unit of spread.

*Step 5 -- Position sizing and risk management:*

  • Size by volatility: Normalize the position so that a 1-standard-deviation adverse move in the spread costs a fixed fraction of capital (e.g., 1-2%). With $\sigma = 0.02$, set notional so that $\text{Notional} \times 0.02 = \text{target dollar risk}$.
  • Stop-loss: Place a stop at $z = 3$ or $z = 4$ (spread at $0.11$ or $0.13$). If the spread blows out further, the cointegrating relationship may be breaking down.
  • Expected holding period: 1-2 half-lives (10-20 days) to capture most of the reversion.
  • Monitor for regime change: Run rolling cointegration tests (e.g., Engle-Granger or Johansen). If the spread fails the stationarity test, exit immediately -- the pair may have structurally decoupled.
  • Exit rule: Close when $z$ returns to the band $[-0.5, 0.5]$, i.e., the spread is back near its mean.

Practical Considerations:

  • Transaction costs matter: with a 10-20 day holding period, you need the expected profit to exceed round-trip costs (slippage + commissions on both legs).
  • The hedge ratio $\beta$ is estimated, not known. Estimation error in $\beta$ introduces basis risk. Re-estimate $\beta$ periodically.
  • The OU model assumes constant $\kappa$, $\mu$, and $\sigma_Y$. In practice these drift. Use a rolling window (e.g., 60-120 days) for parameter estimation.
  • Correlation is not cointegration. Two highly correlated stocks can diverge permanently. Cointegration is what gives you the mean-reversion guarantee (statistically, not literally).

Answer: The z-score is

.0$, signaling a short-the-spread trade: short $A$, long
.2$ units of $B$. The mean-reversion speed is $\kappa \approx 0.069$ per day (half-life 10 days). Expected profit is approximately $0.04$ in log-price terms per unit, captured over 10-20 days. Size the position so that a stop-loss at $z = 3$ represents an acceptable loss, and exit when $z$ reverts near zero.

Intuition

Pairs trading via cointegration is one of the oldest systematic strategies in quantitative finance, and its logic cuts to the heart of what stat arb is about: you are not predicting where any single stock goes, you are predicting that a relationship between stocks will hold. The individual prices are random walks -- unpredictable by construction -- but their linear combination has a stable attractor. The z-score is your distance from that attractor, and mean reversion is your edge. The entire position is designed to be neutral to the common factor driving both stocks, so your P&L comes purely from the spread contracting.

The subtle danger is that cointegration is a statistical property of a historical sample, not a physical law. Pairs break. Mergers, sector rotations, or regime shifts can permanently decouple stocks that looked cointegrated for years. This is why risk management -- stop-losses, rolling re-estimation, and position sizing based on worst-case spread blowouts -- is not optional. The best pairs traders are not the ones who find the strongest signals; they are the ones who survive the inevitable breakdowns.

Open the full interactive solver →