TL;DR: Correlation shows how two investments move relative to each other. You use it to spread your risk. Pair trading uses the same idea to bet that two related stocks will return to each other after an outlier. It is a difficult strategy with its own risks and is not for beginners.
Step-by-step guide
- Collect the daily closing prices of two investments over at least 60 days.
- Convert the prices into daily percentage changes.
- Calculate the correlation with the spreadsheet function CORREL.
- Read the result: close to +1 means they move almost together, close to 0 means little link and close to -1 means opposite moves.
- Calculate the correlation again over a different period to see whether the link is stable.
- Use the result when spreading your portfolio.
- To understand pair trading, follow the price ratio of two related stocks and work out its average and standard deviation.
- Practise on a demo account only, and decide in advance when you will close the trade, even if the link breaks.
What is correlation?
Correlation is a number between -1 and +1 that shows how two things move together.
- +1: they always move in the same direction
- Around +0.8: they usually move in the same direction
- 0: there is no clear link
- Around -0.8: they usually move in opposite directions
- -1: they always move in opposite directions
Two caveats. Correlation describes the past, not the future. And a high correlation does not mean one stock causes the other.
Worked example
Suppose you track the daily price change (in %) of two stocks over 6 trading days:
- Stock A: +1.0 / -0.5 / +2.0 / -1.0 / +1.5 / +0.5
- Stock B: +0.8 / -0.2 / +1.6 / -1.2 / +1.0 / +0.6
Work out the correlation and it comes to about 0.97. On these days the two stocks move almost together. Six days is of course too few to conclude anything. In practice use many more observations and see how the number changes when you shift the period.
Correlation changes over time
The number is not a fixed property. In calm times two investments can have little to do with each other, while in a crisis they often fall together. A portfolio that looks diversified on paper can then be much less protected than you thought. So recalculate correlations regularly, for example over the last 60 days, and do not count on a fixed result.
Using correlation to spread risk
Choosing investments that do not all fall at the same time gives a smoother ride. This is called diversification. A few examples of the thinking behind it:
- Two stocks from the same sector often have a high correlation. Buying both spreads the risk very little.
- Stocks and bonds had little or negative correlation in some periods. In other periods they fell together. So there is no fixed rule.
- Investments in different regions and sectors can reduce risk, but never remove it completely.
Do you want to actively protect against price falls (hedging)? That often involves derivatives such as options, which are complex. First read Options: the Basics and the guide to hedging.
Pair trading: an explanation
Pair trading looks at two related stocks that usually move together, for example two companies in the same sector. The idea: when the ratio between their prices becomes unusually large, it may return to its average. You are then not betting on the direction of the market, but on the ratio between the two stocks.
Worked example in euros
Suppose stock X costs €60 and stock Y costs €51. The ratio Y/X is then 51 / 60 = 0.85. Recent prices show this ratio averaged 0.75, with a standard deviation of 0.05. The z-score is then (0.85 - 0.75) / 0.05 = 2.0. The ratio is unusually high: Y is expensive relative to X.
A pair trader might now reason: sell Y (go short) and buy X, expecting the ratio to return to 0.75. But that does not always happen:
- If the ratio keeps rising to 0.95, your loss keeps growing.
- If something has really changed, for example poor results at X or a takeover at Y, the ratio stays high or rises further.
- Going short brings extra costs and extra risk. In theory the loss on a short position is unlimited.
Where pair trading can go wrong
- The link breaks: the reason the two stocks moved together has gone.
- Costs and interest: two positions mean two sets of costs, plus possible interest on the short position.
- Hard to carry out: not every broker offers short selling, and it often costs extra. Brokers may ask whether you have enough knowledge and experience for these products.
- Too much trust in the past: a ratio that often returned does not always do so.
So pair trading is not a guaranteed or ‘risk-free’ strategy. Test your rules first with a backtest and decide in advance, using the position size calculator, how much you are willing to lose at most.
Calculating and tracking correlation
- Download daily closing prices from a free source or from your broker.
- Put them in a spreadsheet and calculate the daily changes in percent.
- Use CORREL over the last 60 days and watch how the number changes over time.
- Some charting platforms also have a correlation indicator. Check what is available in yours.
Trading involves risk: you can lose all or part of your money, and with short positions even more than your deposit. Past performance is no guarantee of future results. This tutorial is information, not investment advice.
Work it out yourself
Test yourself
Practice questions to check your understanding, not advice.
What does a correlation of about -0.8 between two investments mean?
- They mostly move in the same direction
- There is no relationship
- One stock causes the other to fall
- They mostly move in opposite directions
Show answer
Answer:D. They mostly move in opposite directions
The scale runs from -1 to +1. Around -0.8, two investments mostly move in opposite directions. Correlation says nothing about cause and effect.
Two stocks in the same sector often have a high correlation. What does that mean for diversification if you buy both?
- Both stocks always rise at the same time
- You diversify your risk strongly
- You diversify your risk only a little
- The risk disappears completely
Show answer
Answer:C. You diversify your risk only a little
With a high correlation, the stocks often fall together. Buying both therefore spreads the risk very little.
The price ratio Y/X is 0.85, the average is 0.75 and the standard deviation is 0.05. What is the z-score?
- 2.0
- 17
- -2.0
- 0.1
Show answer
Answer:A. 2.0
z-score = (current value - average) / standard deviation = (0.85 - 0.75) / 0.05 = 2.0. The ratio is unusually high, but there is no certainty that it will return.
What is the biggest risk of pair trading?
- Going short never costs extra
- The relationship between the two stocks changes permanently and the ratio does not return
- The two stocks have the same price
- The correlation is always exactly +1
Show answer
Answer:B. The relationship between the two stocks changes permanently and the ratio does not return
A takeover or poor results, for example, can break the relationship. The loss then keeps growing, and with a short position it can exceed your stake.
What often happens to correlations during a crisis?
- Investments that were barely related often suddenly fall together
- They stay exactly the same
- Only bonds are affected
- They always become 0
Show answer
Answer:A. Investments that were barely related often suddenly fall together
Correlation is not a fixed property. In a crisis, a portfolio that is diversified on paper can be less protected than you thought, so you recalculate correlations regularly.
Frequently asked questions
- What does a correlation of 0.8 mean?
- A correlation of 0.8 means two investments usually move in the same direction, but not always. The scale runs from -1 to +1. At +1 they move exactly together, at 0 there is no link and at -1 they move exactly opposite. A high correlation says nothing about the cause and does not stay the same by itself.
- What is a z-score in pair trading?
- The z-score shows how many standard deviations the current price ratio is from its average. You calculate it as (current value - average) divided by the standard deviation. A z-score of +2 means the ratio is unusually high compared with the past. It is a tool, not a certainty that the ratio will return.
- What are the risks of pair trading?
- The biggest risk is that the link between the two stocks changes permanently, for example through a takeover, new rules or poor results. Then the ratio does not return and the loss keeps growing. Selling a stock you do not own (going short) also needs an account with extra conditions, and costs and interest can add up. Losses can be bigger than your deposit.
- Can a private investor do pair trading in the Netherlands?
- It is possible, but it is not for beginners. Not every broker offers short selling, and not to every client. Brokers may ask about your knowledge and experience. Start with the theory and practise on a demo account before you use real money.