WhitmanTrading

How to Measure Correlation

To measure correlation, compute it on returns rather than prices, over a stated window, and treat the result as a description of that window only. Correlations between related instruments tend to rise during stressed periods, which is when a low reading was being relied on.

Correlation measures how closely two things have moved together. The calculation is standard and the interpretation is where the difficulty lives: the figure is a description of one window, it changes, and it changes in the direction that hurts.

Before you start

Returns rather than prices, because correlating price levels produces nonsense. Two instruments that both rose over a decade correlate highly on price and may share nothing.

A stated window, since the figure changes entirely with the period chosen. Thirty days, ninety days, three years. The number is meaningless without it.

An acceptance that the number describes the past and is least stable when it matters. Related instruments converge under stress, which is when a low reading was being relied on.

The steps

1. Convert prices to returns

A range-bound stretch of price with period changes marked.
Percentage changes, not levels. Illustrative chart - not real market data.

Percentage change from one period to the next, for both instruments, over the same dates. This step is skipped constantly and it invalidates everything after it.

2. Choose and state the window

A slice of price data over a defined period.
The window is part of the answer. Illustrative chart - not real market data.

Ninety days is a common choice for trading horizons. Whatever you pick, the figure is only comparable against other figures computed the same way.

3. Compute the coefficient

A long-horizon price series with two related paths.
One number between minus one and one. Illustrative chart - not real market data.

Any spreadsheet does this in one function. The result runs from minus one to one, where zero means no linear relationship over that window.

4. Read the magnitude, not the sign alone

A slow-moving stretch of price with two diverging measures.
0.8 and minus 0.8 are both strong relationships. Illustrative chart - not real market data.

Above 0.7 in either direction means the two are largely one exposure. Between 0.3 and 0.7 is partial. Below 0.3 is weak over that window and says nothing about the next one.

5. Recompute it over a stressed period

The first half of a price series during a volatile stretch.
The figure that matters is the one from a bad month. Illustrative chart - not real market data.

Find the worst month in your data and compute it again over just that. That number is the one your portfolio will experience when it matters, and it is usually higher.

6. Add correlated positions together for sizing

A section of a price series with combined exposure.
Highly correlated positions are one position. Illustrative chart - not real market data.

Four positions at 0.8 to each other are close to one position at four times the size. Size the group, not the individual holdings.

7. Recompute it periodically

The first half of a price series with a shifting relationship.
It is a moving measurement, not a fixed property. Illustrative chart - not real market data.

Monthly is enough. A relationship that held for two years can change in a quarter, and the portfolio built on the old figure does not update itself.

How to tell it worked

Returns were used, so 0 correlations were computed on price levels.

The window is stated alongside every figure recorded.

A stressed-period figure exists as well as the calm-period one.

And correlated groups were sized together, recomputed at least 1 time per month.

Why it rises when you need it low

A candlestick chart annotated with the round-trip cost of a switch.
Exiting several correlated positions at once costs several round trips. Illustrative chart - not real market data.

Because stressed markets move together. When participants reduce exposure broadly, distinctions between instruments matter less and everything falls at once regardless of what it is.

A section of a price series drawn without volume context.
And thin instruments correlate through their liquidity, not their fundamentals. Illustrative chart - not real market data.

Which means the calm-period figure describes exactly the conditions you were not worried about. A portfolio diversified on a two-year average can behave like a single position during the month it was diversified against.

What the number does not tell you

Why they move together. Two instruments can correlate because of a shared driver, because of a coincidence, or because both are simply liquid assets being sold at the same time.

Whether the relationship will persist. It is measured over history and there is nothing in the calculation that projects forward.

And whether the relationship is linear at all. The coefficient measures linear association, so two things related in a more complicated way can show a low figure while being tightly connected.

Doing it in a spreadsheet, concretely

One column of dates, one column of closing prices per instrument. Same dates for both, with any missing days removed from all columns rather than from one.

A returns column beside each price column. Today’s price divided by yesterday’s, minus one. That is the series the calculation actually runs on.

Then a single correlation function across the two returns columns. One cell, one number, and the whole exercise is under five minutes once the data is in.

Repeat it for every pair you hold. Six positions means fifteen pairs, which sounds like a lot and is one formula copied across a grid — and the grid is what shows you that four of your six holdings are effectively the same bet.

The original data

Of the 24,971 unique videos in research/search-study-corpus.jsonl, 5 mention correlation in the title, at a median of 1,162 views across 5 channels — and none of the 5 is instruction-shaped. Beta appears in 4 at 313 and hedging in 7 at 9,853. The counts come from site/corpus_count.py.

A candlestick series with several gaps, the largest of them marked.
A gap tends to appear across correlated instruments at once. Illustrative chart - not real market data.

5 videos, none instructional, at a 1,162 median. Alongside beta at 4 and diversification at 3, the whole portfolio-risk group is effectively untaught — which is notable given that the failure it describes is the one that concentrates losses into single weeks.

A stretch of price bars cut short at a decision point.
Six positions, all measuring under 0.3. Diversified? Illustrative chart - not real market data.

The answer to the question on that chart depends on the window those figures came from. Compute them over the worst month in your data — if they rise above 0.7 there, the portfolio is diversified during the periods it does not need to be and concentrated during the ones it does.

When it fails

The failure is diversification measured over a calm period, and it produces a portfolio that is one position when it counts. Six holdings, all showing low correlations over a two-year window, all sized independently. A stressed month arrives, the correlations converge, and every position moves the same way at once. The measurement was correct for the window it covered; the mistake was treating a calm-period average as a property of the instruments rather than of the period.

The second failure is correlating prices. That measures the shared trend.

A third is no stated window. The figure is not comparable to anything.

A fourth is sizing correlated positions separately. They act as one.

A fifth is treating it as fixed. It moves within a quarter.

And a sixth is reading a low figure as independence. It is linear association over one window.

Correlation covers the measurement itself. Diversification is what it is usually being computed for. And pairs trading is the strategy that depends on it most directly.

What I actually do

The property that matters is that it moves. A pair measuring 0.2 over a calm year can measure 0.8 during a bad month, which is precisely the month the low figure was doing work in my head. Treating it as a fixed property of two instruments is where the trouble starts.

— Michael Whitman

This page is educational, not financial advice. Test every idea on your own charts before risking money.