← All lessons

Correlation

Measure how two return streams move together · 7 min

FreeGoal: Measure how two return streams move togetherBefore this: Volatility targetingFurther reading: Carver, Systematic Trading
Two generated markets through calm and a shared selloff
0.611.141.6701007
  • Market A
  • Market B

Mostly independent wiggles, then they fall together.

Predict first

Two markets have a correlation of 0.2 in normal times. In these simulated markets, as in many real crises, what happens to their correlation during a shared selloff?

Correlation measures how two return streams move together, from −1 (always opposite) through 0 (unrelated) to +1 (always together). It is about direction and timing, not size: two markets can be correlated 0.9 while one moves three times as much.

ρ = Σ (xᵢ − x̄)(yᵢ − ȳ) ÷ √(Σ (xᵢ − x̄)² × Σ (yᵢ − ȳ)²)

A correlation from a short sample is noisy (roughly ±1 ÷ √n), and it changes with the regime. The generator behind these charts shares one common factor across markets and raises everyone's exposure to it in a crisis, so calm-period correlations understate crisis risk. Measure strategies, not just markets: two different rules on two different markets can still lose on the same days.

Try it: calm days and crisis days
-6%6%6%
  • Calm days (every third shown)
  • Crisis days
Correlation, calm days0.19
Correlation, crisis days0.69
Correlation, all days0.24
Crisis days86 of 2519

Horizontal axis: market A's daily return. Vertical: market B's on the same day. A cloud tilted up and to the right means they move together.

Generated markets, not real data. They show how a rule depends on the market it meets; they do not predict how real markets behave.

Worked calculation

Correlation from four days of returns (in %)

x, y
x: +1, −1, +2, 0 · y: +2, −1, +1, −2
Means
x̄ = 0.5, ȳ = 0
Σ (x − x̄)(y − ȳ)
0.5·2 + (−1.5)(−1) + 1.5·1 + (−0.5)(−2) = 5
Σ (x − x̄)², Σ (y − ȳ)²
5, 10
ρ
5 ÷ √(5 × 10) = 5 ÷ 7.07 = 0.71
Check yourself
3 questions

What usually happens to the correlation between risky markets in a market-wide crash?

Three days of returns: x = +1, 0, −1 and y = +2, 0, −2 (in %). What is their correlation?

Which pair diversifies best? Correlations: A–B 0.7, A–C 0.1, B–C 0.4.

Missed questions come back for review after one day, then three, then a week.

Practice

Strategy 1 has 20% volatility, strategy 2 has 20%, and their returns have a correlation of 1. You put 50% of capital in the first and 50% in the second. What is the blend's volatility (in %)?

Hint: σ² = w₁²σ₁² + w₂²σ₂² + 2·w₁·w₂·ρ·σ₁·σ₂, then take the square root.

More in Drills →

Closing round

Three years of a fresh generated world are on screen; the next two years do not exist yet. Tune the rule on what you can see, commit to two predictions, then generate the future.

0.97×1.04×1.12×0625
  • Your rule so far
Sharpe before split0.37
Return before split5.9%
Max drawdown before-11.7%

Over the next two years, after costs, this rule will…

Will the deepest drawdown after the split be worse than before it?

Generated markets, not real data. They show how a rule depends on the market it meets; they do not predict how real markets behave.

Want to feel it candle by candle? Watch a shock unfold in the flash-crash market →