Concept

Pairs Trading Stack

Pairs Trading Stack, also known as spread construction, hedge ratio, half-life/Ornstein-Uhlenbeck, is a Statistics concept. The Library holds 3 implementations, each one a working definition you can pull into Quant.

Top Pairs Trading Stack indicators

3 total

What is a Pairs Trading Stack?

The pairs trading stack is the chain of statistical steps that turns two related instruments into one tradable spread. Candidates are screened for economic linkage and correlation; a hedge ratio is estimated by regression, or recursively with a Kalman filter so it can drift; and the spread is built as one leg minus hedge ratio times the other. The spread is then tested for cointegration, stationarity of the combination even though each leg wanders, and its reversion is modeled, classically as an Ornstein-Uhlenbeck process whose estimated reversion speed converts to a half-life: the time in which the expected deviation decays halfway back.

Trading reduces to standardized deviations: enter when the spread's z-score stretches beyond a band, exit near the mean, stop out if the relationship has genuinely broken. That last clause defines the risk. Cointegration is a property of a sample, not a law; hedge ratios drift, half-lives lengthen, and a spread that tested stationary can trend further than a position can survive.

How traders use it

  • To generate entries and exits: z-score bands on the spread define stretch (enter) and fair value (exit), a mean-reversion loop that repeats for as long as the relationship holds.
  • To size and time positions from the half-life: a short half-life supports quick round trips, while a half-life of months ties up capital in a slow, uncertain reversion that many traders simply skip.
  • To monitor health: hedge ratios are re-estimated on a rolling or recursive basis, and the pair is retired when cointegration tests stop passing.

Related concepts · Relationships

Concept family

Statistics

45 concepts mapped · 37 in the Library

Pairs Trading Stack FAQ

What is a hedge ratio in pairs trading?

The number of units of the second instrument held against one unit of the first so the combined position isolates the spread rather than either leg's direction. It is usually estimated by regressing one price series on the other, or updated bar by bar with a Kalman filter. A stale hedge ratio leaves directional exposure the strategy was designed to remove.

What does half-life mean for a spread?

The time in which the expected deviation shrinks to half its size, derived by fitting the spread to an Ornstein-Uhlenbeck mean-reversion model: half-life equals the natural log of 2 divided by the estimated reversion speed. Traders use it to set holding periods and judge viability. It is a backward-looking estimate, and it lengthens when the relationship weakens.

Build Pairs Trading Stack your way.

Quant writes, tests, and refines it with you — then it runs on LuxAlgo charting or ports to TradingView.