What is statistical arbitrage? A pairs trade in six stages
You buy a stock because you think it is cheap. Then the whole market falls, and your stock falls with it.
Perhaps your valuation was sensible. Perhaps the company did better than its competitors. You can still lose money. Your position was exposed to the market’s direction as well as the company’s performance.
Now change the question. Instead of asking whether a stock will rise, ask whether it will outperform a related stock. Buy the relatively cheap one, sell the relatively expensive one, and study what happens to their relationship.
Why do we expect the deviation to shrink? A historical relationship supports a hypothesis. It does not require future prices to return to that relationship.
Let’s build one trade from the beginning. We will use two fictional stocks, A and B. We will follow the cash through a winning trade, a losing trade, and a trade where both stocks rise.
Stage one: Why should these prices be related?
Suppose A and B are businesses exposed to similar demand, input costs, and financing conditions. A broad change in their industry could move both stocks.
That gives us an economic reason to investigate a relationship. It does not establish that their prices should be equal. They may have different share counts, profit margins, debt, growth prospects, and exposure to the same industry shock.
“Same sector” helps us choose pairs to investigate. We still need to explain why a particular price relationship should persist.
Imagine that a study of earlier observations suggests the following price-level model:
At a B price of $60, the model’s reference price for A is:
If A trades at $104, the residual spread is 4. A is $4 above the model’s reference price.

Stage two: Turn the spread into a position
The residual is positive, so our hypothesis is that A is expensive relative to B. To benefit if the residual falls, we:
- Short 100 shares of A at $104.
- Buy 150 shares of B at $60.
Why 150 B shares? Because the price-level relationship puts a coefficient of 1.5 on B. For every 100 A shares we sell, we buy B shares.
The hedge ratio is a share ratio in this example. If you estimate a coefficient from returns or log prices, translate it into trading quantities using those units. We cannot take any regression slope and automatically call it the number of shares to buy.
The opening cash flows are:
| Opening transaction | Cash flow |
|---|---|
| Sell 100 borrowed A shares | +$10,400 |
| Buy 150 B shares | −$9,000 |
| Difference before costs | +$1,400 |
If A rises, buying it back becomes more expensive. The short position loses money. There is no fixed maximum loss from the short stock alone because its price has no fixed upper bound.
The long B position offsets some shared price movement. It does not remove all the short position’s risk. A can surge for company-specific reasons while B barely moves.
Also, we do not buy “10 dollars of intercept” for each share. The constant belongs to the reference relationship. With fixed coefficients, the intercept cancels when we calculate price changes. Cash and financing still belong in the trading account, but the intercept is not a third equity position.
Stage three: Follow a successful trade
Suppose we later observe:
The new residual is:
The residual has fallen from 4 to 0.5. We close the trade by buying back 100 A shares and selling the 150 B shares.
| Leg | Calculation | Gross profit |
|---|---|---|
| Short A | +$200 | |
| Long B | +$150 | |
| Combined | +$350 |
There are two profitable legs here: the stock we sold fell, and the stock we bought rose.
But the more useful calculation is the portfolio calculation:
For this fixed-share, fixed-coefficient trade, the gross profit is proportional to the reduction in the residual spread. We did not need either price to return to its opening value.
Assume neither stock pays a dividend or other distribution during the hypothetical holding period. Now include an illustrative cost budget:
| Cost over the entire trade | Amount |
|---|---|
| Commissions and exchange fees | $20 |
| Bid–ask spreads and slippage | $80 |
| Borrow and net financing | $25 |
| Total | $125 |
The net profit is:
These costs are assumed for the example, not typical market quotes. Holding the position longer can increase financing and borrow expense. Trading larger quantities can change execution costs.
If we forecast a smaller residual, the model gives us a possible gross profit. Subtract expected costs before deciding whether the trade is attractive.

Stage four: What if both stocks rise—or both fall?
A pairs trade does not require one stock to rise and the other to fall.
Keep the same opening position. Suppose B rises to $64 while A rises to $107. Both stocks are up, but the new residual is:
The short A leg loses dollars. The long B leg makes dollars. Combined gross profit is $300.
A rose by less than the model predicts for that increase in B. That relative change helped our position.
Now suppose B falls to $56 while A falls to $95. Again, the residual becomes 1:
The short A leg gains $900 and the long B leg loses $600. Gross profit is still $300.
| Exit scenario | A price | B price | Exit residual | Gross profit |
|---|---|---|---|---|
| Both rise | 107 | 64 | 1 | +$300 |
| Both fall | 95 | 56 | 1 | +$300 |
| Original convergence example | 102 | 61 | 0.5 | +$350 |
| A diverges upward | 110 | 60 | 10 | −$600 |
Before calling the position “market neutral”, state which exposure the hedge removes.
At entry, we have $10,400 short and $9,000 long. The net stock dollar exposure is −$1,400. We are not dollar neutral. To equalise those dollar amounts we would buy about 173.33 B shares, but that would no longer match the model’s 1.5 share ratio.
A slope estimated from price levels is not automatically a market beta. Beta neutrality uses sensitivities to a chosen market factor and the dollar exposures of the positions. Even after we satisfy one hedge condition, sector, currency, volatility, and other exposures can remain.
Stage five: A relationship is not a rubber band
Why would we expect the residual to return?
Perhaps a lasting economic driver affects both companies. Temporary order flow or attention may then push their relative prices apart. That is a hypothesis we can investigate. Sometimes the apparent deviation is new information about one company, and the old relationship should change.

Return to our position. A rises to $110 while B stays at $60. The residual becomes 10, and gross profit is:
The $600 loss exists before costs. The spread is now “even cheaper to short” according to the old model—but that interpretation is exactly what we must question.
A merger announcement, a change in business mix, deteriorating credit, or a persistent change in demand can alter a relationship. Borrow can also become unavailable or expensive before the prices converge.
Before trading, set a maximum holding period, exposure limits, and loss limits. Define when you will stop using the model. A stop triggers a planned response. It cannot guarantee the execution price, and it may close a position that later converges.
When prices disagree with the model, ask two questions. Does the deviation support a trading opportunity? Or does it show that the model needs to change?
Stage six: Decide whether the signal is worth trading
A residual of 4 is not meaningful without scale. If historical residual fluctuations are usually around 0.5, it may be unusual. If they are usually around 8, it may be ordinary.
A common summary is a standardised residual:
Here, and are estimates from data available when the decision is made. If the estimated mean is 0 and standard deviation is 2, our entry residual of 4 gives .
The z-score measures distance from the estimated centre in units of estimated standard deviation. It is not automatically a probability of convergence, and “two standard deviations” is not automatically a profitable entry threshold.
Try the trade yourself
Keep the original position: short 100 A at $104 and long 150 B at $60. At exit, A is $101 and B is $59. The model coefficients remain fixed. Assume total costs are still $125.
What is the exit residual, the profit on each leg, and the net profit?
Both prices fell. One leg lost money. The spread still converged, and the portfolio made a small net profit. If actual costs exceeded $150, the same successful spread forecast would produce a losing trade.
Where this goes next
References
- US Securities and Exchange Commission, Key Points About Regulation SHO: short-sale borrowing and repayment mechanics in US equities.
- Clive W. J. Granger, Time Series Analysis, Cointegration, and Applications, Nobel lecture, 2003: common trends and cointegration.
Go deeper with lessons, derivations and worked exercises behind this article.