On this page
In short
Pairs trading does not look at one price but at two. If two instruments normally move almost alike, the gap between them is usually small. When it becomes unusually wide, the program sells the one that ran away and buys the one that lagged behind.
In the schematic below the candles therefore show no price but exactly this gap: price A minus price B, in pips. The strategy wins when the gap returns to the mean and loses when the relationship breaks.
The basic idea of a return to the mean is explained on the mean reversion page. Why past relationships look more stable in a backtest than live is covered in Why EAs fail live.
The strategy as a schematic
A drawn price path, no market data. First the case where the rule works, then the same routine when it fails.
- Closed
- ±0 pips
- Open
- –
- Open volume
- –
Schematic, no market data: a drawn price path, results in pips weighted to 0.10 lots. Not a backtest and no statement about any real EA.
How the strategy trades
- Pick two instruments that have moved very much alike in the past (e.g. EURUSD and GBPUSD, or two stock indices).
- Keep calculating the gap between them (the spread) and determine its usual mean.
- If the gap becomes unusually wide: sell the stronger instrument, buy the weaker one. Together the two orders are one position on the gap.
- When the gap returns to the mean, close both legs at the same time.
- If the gap keeps widening, a stop on the gap ends the trade, not a stop on either price.
Where the risk sits
Pairs trading counts as market neutral because a buy and a sell are open at the same time. That protects against a joint move of both instruments, not against the real risk: that the link between them breaks.
A past relationship is not a rule. A rate decision, news about only one of the two, or a new trend can shift the gap for good. The expected return then becomes a loss that grows until the stop is hit.
Each leg pays spread and, overnight, swap. With two positions open these costs come twice. With small expected deviations they can eat a large part of the result.
When it works, when it fails
Tends to work when …
- Two instruments with a stable, economically grounded relationship.
- Deviations caused by short-term events that resolve again.
- Low costs relative to the expected return.
Tends to fail when …
- The relationship breaks for good and the gap does not come back.
- News that affects only one of the two instruments.
- Long holding times with double swap costs.
How to recognise it in an EA
Traces in the trade log of a live account, whatever the vendor calls the EA.
- Two positions on different symbols opened in the same second, one buy, one sell.
- Both legs close together, often with a profit on one side and a loss on the other.
- A trade's result only makes sense as the sum of both legs.
- Often holding times of days and swap on both positions.
Typical settings
| Setting | Typical | Effect |
|---|---|---|
| Pair selection | correlation over e.g. 6–12 months | Past correlation, no promise for the future. |
| Entry threshold | e.g. 2 standard deviations from the mean | Higher = rarer, but clearer deviations. |
| Exit | return to the mean | Some close halfway. |
| Stop | e.g. 3–4 standard deviations or a time limit | Caps the loss when the link breaks. |
| Size ratio | weighted by volatility | Equal lot size is not equal risk. |
Common ranges from EA manuals and set files, not a recommendation.
EAs in our tests built this way
No EA in our tests is explicitly tagged with this design yet. Many EAs combine it with other mechanics; the trade log usually shows it sooner than the product description. All EA reviews →
Related strategies
- Mean reversionTrades against stretches and waits for price to return to its mean.
- HedgingLocks a losing position with an opposite one and freezes the loss instead of closing it.
- ArbitrageExploits price gaps between a fast price feed and a slower broker. Banned by most retail brokers.
All strategies →All designs compared: EA strategies explained →
Frequently asked questions
What is pairs trading?
Is pairs trading market neutral?
What is the difference between pairs trading and mean reversion?
Video: the strategy in under a minute
The same animation as a video with subtitles, for those who prefer to watch.