EdgeProof

Strategies / Intermarket

Pairs / spread mean reversion

When two markets that usually move together drift unusually far apart, bet on them coming back together.

advanced1h · 4h · 1dStudy onlyTested in published research

Overview

This guide is study-only: the strategy needs a second market lined up candle by candle with the first, which the platform's setup bank does not provide yet, so there are no setups to practise or test.

Pairs trading looks for two markets that usually move together, such as EURUSD and GBPUSD. When they drift unusually far apart, it bets on the gap closing. Evan Gatev, William Goetzmann and Geert Rouwenhorst (2006) found it profitable on US stocks from 1962 to 2002, with returns declining in later years. Ernest Chan (2013) covers the method and its pitfalls.

The library's version builds a spread: the log price of this market minus β times the log price of the other, with β estimated from the previous 200 candles. It turns the spread into a z-score using the same 200 candles. When z rises above +2, this market is expensive compared with the other, so the rule sells it; below −2, it buys it.

Note that the library rule trades one leg only, this market, with a 1.5 × ATR(14) stop. A classic pairs trade holds both legs (sell the expensive one, buy the cheap one) so that moves they share cancel out. With one leg, you keep that shared risk.

The exact rules we test

These are the rules the platform runs over market history to find setups. Every setup you'll see in practice and tests matched them on a closed candle.

  1. Spread: log price of this market minus β × log price of the other (β from the look-back)
  2. Short this market when the spread's z-score is above k, long when below −k
SettingDefaultWhat it does
Look-back200 candlesCandles for β and the z-score.
Entry z2 σHow far apart the markets must drift.

Default exits: Exit when the z-score returns to 0; stop at 2k

What forms the setup

The two markets

Two markets with a real economic link, such as two European currencies against the dollar. A link you can explain is more likely to last than one found by scanning charts.

β (hedge ratio)

From the previous 200 candles, how much this market's log price moves for each unit move in the other's. It sets how much of the other market the spread subtracts.

The spread

log(this market) − β × log(other market). When the two move together as usual, the spread wobbles around its average.

z-score of the spread

Today's spread minus its 200-candle average, divided by its standard deviation over the same candles. Beyond ±2 is the trigger.

ATR stop

The library rule puts a fixed 1.5 × ATR(14) stop on this market.

How to read the chart, step by step

  1. Choose a pair with a reason to co-move. EURUSD and GBPUSD share the dollar side and close economic ties. Start from a relationship you can explain.
  2. Estimate β. Over the previous 200 candles, regress this market's log price on the other's. β tells you how many units of the other market move with one unit of this one.
  3. Build the spread and its z-score. Spread = log(this) − β × log(other). Compare the current spread with its average and standard deviation over the previous 200 candles. Only past candles are used, so nothing from the future leaks in.
  4. Find the trigger. A short fires on the first candle where z rises above +2. A long fires on the first candle where it falls below −2.
  5. Ask why it diverged. A surprise central-bank decision in one currency can shift the relationship for good. A slow drift with no news is the better candidate.
  6. Plan the exit. The classic exit is the z-score returning to 0. The library's rule also uses a fixed 1.5 ATR stop on this market.

Entry

In the library's rule, enter this market at the close of the first candle where the spread's z-score crosses beyond ±2: sell when it rises above +2, buy when it falls below −2. β, the average and the standard deviation all come from the 200 candles before the setup.

Stop

The library rule places a fixed 1.5 × ATR(14) stop on this market. The classic pairs approach adds a second safety exit: get out if the spread keeps widening, for example at twice the entry z-score, because the relationship may have broken.

Target

The natural exit is the z-score returning to 0, the spread's average. If you study it with a fixed target instead, measure it in R of the 1.5 ATR stop and compare it with how far this market must move for the spread to close.

When it works, and when it doesn't

Helps

  • Two markets with a clear economic link and a stable β over many months.
  • A divergence with no news behind it, such as a slow drift in a quiet week.
  • A spread that has crossed ±2 and come back many times before.
  • Stable relationships.

Hurts

  • News specific to one market, such as a surprise rate decision in one currency.
  • β changing sharply from one month to the next, a sign the relationship is unstable.
  • A spread trending away for weeks: the relationship may be breaking for good.
  • Trading one leg only during a strong shared move, which adds unhedged risk.
  • When the relationship breaks for good.

Common mistakes

  • Confusing correlation with a stable spread. Two markets can move together day to day and still drift apart for months.
  • Fading a divergence caused by real news in one market.
  • Forgetting that a one-leg trade keeps the shared market risk.
  • Using a look-back so short that β and the average jump around.
  • Having no exit for a broken relationship.

Pre-trade checklist

  • ☐Do the two markets have a real economic link?
  • ☐Has β been stable?
  • ☐Did z just cross beyond ±2?
  • ☐Is there no market-specific news behind the divergence?
  • ☐Do I know my exit at z = 0 and my stop if the spread keeps widening?
  • ☐Do I know whether I am trading one leg or both?

Practising it

  • There are no setups for this strategy yet, so you cannot practise or test it directly. In the Practice Center, train the same skill on the z-score reversal strategy, which applies the z-score idea to one market: fade stretches that have no news behind them.
  • Open EURUSD and GBPUSD on the same timeframe and note when they drift apart, and whether news explains it.
  • Take this quiz until you can explain β, the spread and the one-leg risk in your own words.

Evidence

Tested in published research. Profitable on US stocks 1962–2002, declining later (Gatev, Goetzmann & Rouwenhorst).