Pairs trading is a market-neutral strategy that bets on the relationship between two correlated assets rather than the direction of either one. When the spread between them stretches further than it historically does, you go long the underperformer and short the outperformer, and wait for it to revert. Your P&L depends on convergence, not on whether the broader market goes up or down.
That is the premise in two lines. The interesting part is everything that happens after, because most retail material treats pairs trading as a tidy mean-reversion problem when in practice it is a market-structure problem with a statistical wrapper. This piece walks through both the mechanics and the failure modes, with a focus on forex and crypto, since those are the markets you can actually trade on a CFD account.
The bet you are actually making
If two assets are economically linked, their prices wander around together. EUR/USD and GBP/USD share the same quote currency, both are driven by European-versus-US growth and rate differentials, and both react to risk-on and risk-off shifts in roughly the same way. Their daily moves are not identical, but the gap between them oscillates within a band.
The same is true of BTC and ETH. Different assets, different narratives, but a deep enough economic link that the ratio between them sits inside a recognisable range most of the time. The pairs trader's bet is that the gap is the predictable thing, even when the underlying assets are not.
You can write this two ways. As a long position, you sell what is rich and buy what is cheap, and you make money when the two re-anchor. As a hedge, you have isolated the spread from the broader market, so a market-wide selloff that drags both legs down hurts you less than a directional trade would. The market-neutral framing is what makes pairs trading attractive to funds: they can size up without taking a view on equities or crypto as a whole.
Correlation is not enough. You need cointegration.
Two random walks can look correlated by accident over short windows and then diverge forever. Cointegration is the stronger condition: even if both prices drift, some linear combination of them is mean-reverting. That mean-reverting linear combination is the spread you trade.
In practice, you test for cointegration with one of two tools. The Engle-Granger test runs a regression of one price series on the other, then checks whether the residuals are stationary using an Augmented Dickey-Fuller test. The Johansen test handles the multi-asset version. Either way, the workflow in Python is two lines:
from statsmodels.tsa.stattools import coint
score, pvalue, _ = coint(price_a, price_b)
# pvalue < 0.05 means we reject "no cointegration" at 95% confidence
What people skip past, and what matters more than the test, is that cointegration is a statement about a particular historical period. EUR/USD and GBP/USD show evidence of cointegration in some studies and not in others, depending on the years tested and the test specification. The textbook reference (Alexander, 1999, "Optimal hedging using cointegration") makes the point that whether a pair is cointegrated is a function of the macro regime, not a permanent property of the pair. Treat the test as a filter, not a guarantee.
Building the spread and the z-score
Once you have a candidate pair, you need a single number that tells you "the spread is unusually wide right now." The standard approach is the z-score on the spread:
import statsmodels.api as sm
# Hedge ratio: how many units of B equal one unit of A on average
model = sm.OLS(price_a, sm.add_constant(price_b)).fit()
hedge_ratio = model.params[price_b.name]
spread = price_a - hedge_ratio * price_b
# Rolling z-score
N = 30 # window in days
zscore = (spread - spread.rolling(N).mean()) / spread.rolling(N).std()
The z-score is the spread, demeaned, divided by its rolling standard deviation. A z-score of +2 means the spread is two standard deviations above its rolling mean. A z-score of zero means it is sitting on the mean.
The conventional rules are:
z > +2: spread is unusually wide. Short A, long B.
z < -2: spread is unusually narrow. Long A, short B.
|z| < 0.5: close both positions.
One thing worth flagging because every retail tutorial glosses over it: the 20-to-60-day rolling window is a retail convention, not the original academic methodology. The seminal study (Gatev, Goetzmann and Rouwenhorst, 2006, Review of Financial Studies) used a 12-month formation period and a 6-month trading period with a 2-standard-deviation trigger on normalised prices. The rolling window approach you see in most YouTube tutorials is a much shorter, faster-trading variant. Both can work, but they are betting on different things. Short windows assume the spread mean-reverts on a swing-trade timescale. Long formation windows assume it mean-reverts on a position-trade timescale.
Pairs trading in forex
Forex is where pairs trading was first formalised, partly because the macro linkages are clean. EUR/USD and GBP/USD are the canonical pair. They share the USD quote, both EUR and GBP are major European currencies, both are sensitive to European-versus-US rate differentials, and both react to global risk appetite in roughly the same direction.
The trade has a clean intuition. When the Bank of England surprises hawkishly, GBP/USD spikes while EUR/USD lags. The spread widens. If the surprise was about UK-specific data rather than a global re-rating, the spread should narrow as the market digests the news and re-anchors GBP relative to EUR. You short GBP/USD, buy EUR/USD in a hedge-ratio-adjusted size, and you make money on the re-anchoring, not on whether the dollar rallied or sold off in the meantime.
The other classic forex pair is AUD/USD and NZD/USD. Both are commodity-currency proxies, both have central banks that respond to similar global cycles, and the spread between them tracks the relative strength of Australian and New Zealand growth. Cointegration tests on this pair have a long history of returning significant results, with the obvious caveats about regime sensitivity.
What forex pairs traders learned the hard way
On 15 January 2015, the Swiss National Bank removed the 1.20 floor on EUR/CHF without warning. The pair fell from 1.20 to a Bloomberg-reported intraday low near 0.85 on some venues, settling around 1.05 by the end of the day. Anyone running EUR/CHF cointegration models, of which there were many, watched their model's mean-reverting target disappear in minutes. The "cointegrating force" had been a central-bank policy, not a market relationship, and when the policy went the model went with it.
On 23 June 2016, the Brexit referendum result hit markets and GBP/USD fell roughly fifteen percent against the dollar over the following weeks. The EUR/USD versus GBP/USD spread that had been mean-reverting for years widened sharply and stayed wide. Studies looking at volatility transmission between GBP and the euro find a measurable decoupling around the referendum date. The cointegration that had survived the Eurozone debt crisis did not survive a UK-specific political shock.
Both events teach the same lesson. Pairs trading models assume the structural relationship that produced the historical cointegration is still in place. When central banks change their stance, when political regimes change, or when one economy structurally diverges from the other, the model has nothing to revert to.
Pairs trading in crypto
Crypto has the highest pairwise correlation of any asset class. Over the period January 2024 to September 2025, the 30-day rolling correlation between BTC and ETH sat around 0.94 on daily log returns. The broader cluster of BTC, ETH, and SOL has been in the 0.7 to 0.9 range for years. That is the kind of structural co-movement that pairs traders dream about in equities, where 0.5 is already considered strong.
The ETH/BTC ratio is the most-watched pairs trade in crypto. It peaked near 0.148 in June 2017, reached a lower cycle high of about 0.087 in December 2021, traded in a 0.05-to-0.08 range through 2022 and 2023, and sat near 0.027 in May 2026, a ten-month low. The entire altcoin-rotation thesis rides on whether this ratio mean-reverts within a cycle. The trade, when it works, is structural. Both assets are deep, both have macro drivers that overlap, and the relationship has survived multiple cycles.
What is unique about crypto pairs trading
Three things are different in crypto and they all matter.
Correlations go to one in a sell-off. Equity pairs trading works partly because in a sell-off, defensives go up and cyclicals go down, and the spread widens predictably. Crypto sell-offs do not have defensives. BTC drops fifteen percent, ETH drops twenty-two percent, alts drop thirty-five percent, and your "market-neutral" position is just leveraged long-or-short the whole complex. The hedge breaks at exactly the moment you need it.
Funding rates eat the spread. When you hold a pairs trade on a CFD or perpetual contract, you pay or earn funding on both legs. BTC perp funding at thirty percent annualised plus ETH perp funding at twenty-five percent annualised means a long-ETH-short-BTC position is bleeding five percent a year before the spread does anything. Spot pairs trading avoids this. Leveraged pairs trading on perps or CFDs does not. The funding cost is the carry of the trade, and it is easy to miss in a backtest that uses spot prices.
One leg can go to zero. This is the part that separates crypto from anything else. In equities, you almost never see one half of a pair become worthless overnight. In crypto, it has happened multiple times and recently.
Terra/Luna, May 2022. UST was an algorithmic stablecoin meant to peg to one dollar. It began depegging on 7 May 2022, fell to roughly 0.67 by 10 May, and bottomed near 0.03. LUNA, the volatility-absorbing counterpart, went from 87 dollars on 5 May to 0.0005 dollars by 13 May. The Terra chain was halted on 12 to 13 May. Any pairs trade that had Terra or Luna on one leg was not a convergence trade. It was a one-way exit at zero.
FTX/FTT, November 2022. CoinDesk published a piece on 2 November 2022 exposing Alameda''s FTT-heavy balance sheet. FTT traded at about 24 dollars on 6 November, crashed below 5 dollars within 24 hours, and hit 2.10 dollars by 13 November. FTT''s all-time high in September 2021 was around 78 dollars. SRM, which was structurally tied to the FTX ecosystem, fell from roughly 0.80 dollars to 0.24 dollars in days.
USDC, March 2023. USDC briefly depegged from one dollar to about 0.87 on 11 March 2023, after Circle disclosed that 3.3 billion dollars of its reserves were trapped at Silicon Valley Bank. It recovered to 0.99 by 13 March once regulators announced SVB depositors would be made whole. The mean-reversion did happen, but only because a regulatory decision pulled the asset back. A different outcome that weekend would have produced a permanent loss on the long-USDC leg of any "stablecoin convergence" trade.
If you are pairs trading in crypto, the risk model needs a column for "leg dies entirely" that you almost never need in equity or forex pairs trading. Position sizing has to assume any leg can lose ninety to one hundred percent without a chance to exit. That is not paranoia, it is the empirical base rate over the last four years.
What kills pairs traders
The history of pairs trading blow-ups has a consistent shape, and it is older than crypto.
Long-Term Capital Management, 1998. LTCM ran convergence trades across global fixed income, including pairs across sovereign bonds and on-the-run versus off-the-run Treasury spreads. The models said the spreads had to converge. They were correct on the underlying economics. They were destroyed by what happened first. When Russia defaulted on roughly 13.5 billion dollars of domestic debt in August 1998, global investors fled to liquidity, and every convergence trade widened simultaneously. LTCM lost 44 percent in August alone. A 14-bank consortium organised a 3.6 billion dollar rescue in September. The trades "would have worked" if LTCM had unlimited capital and could ride out the divergence, but no fund has unlimited capital, and the divergence kills you before the convergence saves you.
The lesson generalises. Convergence trades work until correlated liquidity shocks turn every spread into a one-way exit at the worst possible moment. The same shape applies whether you are trading sovereign-bond spreads, forex pairs around a central-bank shock, or crypto pairs through a chain-collapse event. You need to size the position so that the divergence does not stop you out before the convergence finishes.
Execution: the part most tutorials skip
Pairs trading is a two-legged trade. You are not buying one thing and waiting. You are buying one and shorting another in a hedge-ratio-adjusted size, and you need both fills to land near-simultaneously, near your intended prices. If one leg fills at a worse price than the other, you have just paid slippage on the trade you have not even put on yet.
This matters more in pairs trading than in directional trading, and is the single most under-discussed cost in retail pairs-trading content. A directional trader who pays 0.5 pips of slippage on EUR/USD has lost half a pip. A pairs trader who pays 0.5 pips of slippage on EUR/USD and another 0.5 pips on GBP/USD has lost a full pip before the spread does anything, and the spread itself might only be a few pips wide. The execution cost can eat the entire edge.
What you actually need:
Raw spreads on both legs. Pairs trading is a tight-spread strategy. Mark-up on the spread is a direct tax on every entry and exit.
STP/ECN execution. You want the two legs filled against the same kind of liquidity, not against an internal book that might requote one leg.
Predictable commission per side. A flat per-side commission lets you model execution costs cleanly. A spread mark-up that widens at the margin destroys the model.
Working hours that overlap. Crypto trades 24/7. Forex has session liquidity windows. The pair has to be liquid on both legs at the same time, otherwise the spread you backtested on closing prices is not the spread you will trade.
LHFX runs STP/ECN execution with raw spreads and a flat 3 dollars per side commission across forex, indices, commodities, and crypto. The point is not the marketing line, the point is that the execution structure matters more than the model for any strategy that depends on tight spreads on two legs at once.
Trying it on LHFX, honestly
The pairs that are actually tradeable on a CFD account:
Forex:EUR/USD versus GBP/USD, or AUD/USD versus NZD/USD. Cointegration tests on these pairs return significant results across most rolling windows, with the caveats above.
Crypto:ETH versus BTC as the canonical pair. Watch for narrative breaks and check funding-rate parity before sizing.
Indices:S&P 500 versus Nasdaq 100. Tighter correlation than forex pairs, with sector concentration in NAS100 creating predictable widenings around earnings.
Commodities:Gold versus Silver. The gold-to-silver ratio has its own mean-reverting history, with the warning that the structural relationship has weakened over the last decade.
A few practical points that retail content typically buries:
Hedge ratio is not 1:1. The right size on the short leg is the OLS coefficient from regressing the long leg on the short leg, not equal notional. Equal-notional pairs are not hedged. Re-estimate the hedge ratio periodically.
Walk-forward, not in-sample. If you fit a model on data through 2024 and "test" it on data through 2024, you are not testing anything. Test on data that did not exist when you specified the model.
Position sizing assumes one leg can go to zero in crypto. In equities and forex this is paranoia. In crypto it is the empirical base rate.
The mean-reverting target moves. The "mean" in your z-score is a rolling estimate. Regimes shift. Recalculate at every step. Do not anchor on a 12-month-old mean.
Slippage and funding eat more than your model predicts. Budget two to three times what a naive backtest implies, and reconsider the trade if the implied edge is smaller than that.
Bottom line
Pairs trading is a real, durable strategy that has a published academic literature, a forty-year track record on equities, and a workable adaptation to forex and crypto. It is also a strategy where the model is the easy part and the failure modes are the hard part. The funds that succeed at it run portfolios of dozens of pairs at small sizes, accept that any individual pair might break, and pay obsessive attention to execution. The retail traders who blow up running it almost always size up a single pair, ignore funding, and treat the historical cointegration as a guarantee rather than a filter.
If you are going to try it, start small, use real raw-spread execution, model funding explicitly, and assume any leg can fail. The strategy works when it is treated as a portfolio of statistical bets with strict risk management. It does not work as a single-pair conviction trade.
This content is for informational purposes only and does not constitute investment advice. CFDs are complex instruments and come with a high risk of losing money rapidly due to leverage.