Pairs trading

ArbitrageAdvanced

Pairs trading buys one stock and shorts a related stock when the spread between them stretches, then closes both when the spread snaps back. The bet is on the relationship, not on the market's direction. A distance rule matches stocks with a similar price history. A cointegration rule asks whether the spread is statistically stationary.

Not investment advice. Nothing here is a recommendation to buy or sell anything. Backtests and historical studies are not guarantees, and a rule that worked in one sample can fail in the next. Trading can lose money. Links are for education, not endorsements. Do your own research.

Rules
Form pairs over a lookback, often a year, either by minimizing the distance between normalized prices or by testing cointegration. Trade when the spread's z-score exceeds a threshold, such as 2, and exit near zero or after a time stop. Hedge the sizes so the pair is roughly dollar-neutral, and drop pairs that stop moving together. Re-estimate the relationship on a schedule. Do not form the pair on the same data you trade.
Where AI fits
Searching thousands of pairs will find false relationships, so AI should rank candidates with a penalty for data mining and prefer pairs that also make economic sense. A model can watch the hedge ratio drift and shut the pair off when the spread stops mean-reverting. An LLM can draft the test, but the cointegration step needs a real statistics library, not a guessed formula.
Markets
Liquid stocks in the same industry, and some futures calendars or related commodities. Borrow has to be available on the short leg.
Timeframes
Daily bars, with pairs held for days to weeks. Intraday versions need a much tighter cost model.
Risks
A spread can widen because the relationship broke, not because it is cheap. That is how pairs blow up. Short borrow can be recalled. Testing every possible pair and keeping the winners is a classic false discovery.

← Back to all strategies