How to calculate the hedge ratio in pairs trading (OLS, rolling and dollar-neutral)
The hedge ratio, usually written β, decides how much of one asset offsets the other. Get it wrong and a "market neutral" pair trade quietly becomes a directional bet.
The regression
The standard estimate is an ordinary least squares regression of one log price on the other over a formation window:
ln(A) = α + β · ln(B) + ε
The residual ε is the spread. If the two series are cointegrated, the spread is stationary and β is the combination that makes it so. Using log prices means β behaves like a ratio of percentage moves: with β = 0.8, a 1% move in B corresponds on average to a 0.8% move in A.
From β to position sizes
With a log-price hedge ratio, a simple sizing rule is to hold money amounts in proportion to β:
dollars in B = β × dollars in A (opposite direction)
Example: β = 0.8 and you allocate $10,000 to A. You hold about $8,000 of B on the other side. Divide each amount by the current price to get share or coin quantities. Arbitrading's Pair lab does this arithmetic for any amount you enter.
Price-level vs log-price regressions
Some textbooks regress raw prices: A = α + β·B. Then β is a number of units of B per unit of A, and the spread is in currency. It works, but the spread's volatility grows with the price level, so a z-score computed years ago is not comparable with today's. Log prices avoid that and are the more common choice for screening many pairs.
Which asset goes on the left?
OLS is not symmetric: regressing A on B does not give exactly 1/β of regressing B on A, and the Engle–Granger test can give different p-values in each direction. Common fixes are to run both directions and keep the stronger result, or to use a symmetric method such as total least squares. Whatever you choose, apply it consistently.
The hedge ratio drifts
Businesses change, and so does the relationship between their share prices. A β estimated over 2021 can be out of date by 2023. Three common responses:
- Rolling OLS: re-estimate β every day on a trailing window, for example 252 days. Simple, and free of look-ahead bias when done properly.
- Kalman filter: treat β as a hidden state that moves slowly and update it with each new observation. More responsive, but it adds parameters that can be overfitted.
- Fixed β per trade: keep the β that was in force when the position opened until it closes, so that the hedge does not change mid-trade.
Look-ahead bias
A β fitted on the full history and then used to backtest the same history knows the future. In a backtest, the hedge ratio on each date must come only from data up to that date. See backtesting a pairs trading strategy.
Where to see it
Every pair page on Arbitrading shows the current hedge ratio next to the cointegration tests, for example XOM vs CVX. Pair lab uses a rolling β and turns it into leg sizes for the amount you choose. These are calculations, not advice on what to trade.