Pairs Trade¶
A pairs trade is a market-neutral strategy that simultaneously buys one stock and shorts a highly correlated stock in the same sector to profit from the relative price movement between the two securities. The strategy isolates the spread between the two positions, removing broad market risk. The trade profits when the spread reverts to its historical mean, regardless of overall market direction.
HOW IT WORKS¶
A pairs trade is built by identifying two stocks with a high historical correlation, then calculating a hedge ratio using linear regression of their returns. The spread is defined as:
Spread = Price of Stock A − (Hedge Ratio × Price of Stock B)
The trader monitors the spread for deviations from its historical mean. A common entry signal is a move greater than two standard deviations from the mean. Position sizing uses the hedge ratio to ensure the dollar exposure of the short leg offsets the beta of the long leg:
Short Shares of B = (Hedge Ratio × Long Shares of A × Price of A) / Price of B
The trade is closed when the spread reverts to the mean. The strategy carries real risk: if the historical correlation breaks down, losses can accumulate on both legs simultaneously. Borrow costs, dividends, corporate actions, and short squeezes can all distort the spread and force an early exit.
IN TAPEBOARD¶
Tapeboard displays the live spread and z-score for any two tickers you define, so you can monitor deviation from the historical mean without manual calculation. The pairs trade panel shows the hedge ratio derived from rolling regression, the current spread in both price and standard deviation terms, and a historical chart of spread behavior. Entry and exit thresholds can be set as z-score alerts, triggering a notification when the spread crosses your defined level. Position sizing is calculated automatically based on the hedge ratio and your chosen share count for the long leg.