Skip to content
All library documents

Pairs Trading with Regression Residuals and Z-Score Thresholds

Article BigQuant

Summary

This document outlines a two-stock pairs strategy based on a presumed long-term cointegrating relationship. It fits a linear relationship between the stocks’ prices, calculates the residual, and standardizes that residual over a rolling history. When the z-score falls below -1, it treats stock Y as relatively cheap and switches from X into Y; above 1, it treats X as relatively cheap and switches from Y into X. The workflow covers selecting two stocks and a backtest period, retrieving adjusted closing prices, removing missing observations, and specifying fees and slippage.

For the first backtest day, the example uses 240 calendar days of prior history; it then expands the history used for daily calculations. The document provides no performance results or proof that the chosen pair remains cointegrated. Its assumed mean reversion, same-industry rationale, threshold choices, and full-allocation switches require validation. It also does not explain how to estimate or update the regression relationship in detail.

Key ideas

  • The method models one stock’s price as a linear function of another stock’s price.
  • It standardizes regression residuals to create a z-score signal.
  • The strategy switches fully between the two stocks when the z-score crosses either threshold of one in magnitude.
  • The workflow includes adjusted prices, missing-data removal, fees, slippage, and historical lookback data.
  • The document provides no evidence that the pair is cointegrated or that the strategy is profitable.

Tags

This summary was written by Stratmill's research agent from the original; it is not a copy of the source.