Direct Answer
Rolling correlation is the Pearson correlation coefficient between two return series, recalculated over the most recent n periods, commonly 30, 60, or 90 days, shifting forward each period. It ranges from -1 (perfectly inverse) to +1 (perfectly aligned), with 0 meaning no linear relationship. Because the window moves forward continuously, rolling correlation shows that the relationship between two assets isn't constant, including the commonly observed pattern of normally weakly-correlated assets moving toward higher correlation during broad market stress.
Key Takeaways
- Rolling correlation = the Pearson correlation coefficient between two return series, computed over the most recent n periods and recalculated as the window shifts forward.
- Common lookback windows are 30, 60, or 90 days; the choice trades off responsiveness against noise.
- Readings range from -1 (perfectly inverse) to +1 (perfectly aligned), with 0 meaning no linear relationship was detected over that window.
- Correlation between two assets isn't fixed, it can rise or fall meaningfully as the window rolls forward, including a commonly observed convergence toward 1 during periods of market stress.
- Rolling correlation is backward-looking and measures only linear co-movement, not causation and not the magnitude of either asset's moves.
What Is Rolling Correlation?
A single correlation figure calculated over an asset's entire price history treats the relationship between two assets as fixed. In practice, that relationship changes: two assets can trade in near lockstep for months, then decouple, then realign. Rolling correlation addresses this by recalculating the correlation between two return series over a moving lookback window, for example, the most recent 60 trading days, and shifting that window forward by one period each time a new data point arrives. The result is a correlation value that updates continuously rather than a single static snapshot.
The underlying calculation is the same Pearson correlation coefficient used in general statistics, applied specifically to each asset's returns (not raw prices) over the chosen window. Using returns rather than price levels avoids the distortion that two assets can appear highly correlated over long periods simply because both trended upward, even if their period-to-period moves aren't actually related.
The Formula
Rolling Correlation = the Pearson correlation coefficient between two return series, computed over the most recent n periods (commonly 30, 60, or 90 days), shifting forward each period.
Readings range from -1 (perfectly inverse, when one return series rises, the other falls by a proportional amount) to +1 (perfectly aligned, both return series move together by a proportional amount), with 0 meaning no linear relationship was detected over that window. As each new period's return is added to the window and the oldest period's return drops off, the coefficient is recalculated, so the reported value can shift from one period to the next.
Worked Example
Hypothetical example, for education only.
To keep the arithmetic visible, this example uses a 5-day window rather than a full 30-, 60-, or 90-day window used in practice. Suppose Asset A and Asset B post the following daily returns:
| Day | Asset A return | Asset B return |
|---|---|---|
| 1 | +1.0% | +0.9% |
| 2 | -0.5% | -0.4% |
| 3 | +0.8% | +0.6% |
| 4 | -0.2% | -0.3% |
| 5 | +0.4% | +0.5% |
The average return over the window is +0.30% for Asset A and +0.26% for Asset B. Computing the Pearson correlation coefficient from each day's deviation from its own average, the standard formula behind rolling correlation, produces a coefficient of approximately 0.98 for this 5-day window.
A reading near +1 means the two return series moved together almost proportionally over this particular window: on days Asset A's return was above its own average, Asset B's return was also above its own average, and by a similar relative amount. Rolling the window forward by one day, dropping Day 1 and adding Day 6, recalculates the same coefficient over the new 5-day span, and the result can move meaningfully if Day 6's returns don't follow the same pattern.
How Rolling Correlation Is Used
Diversification checks
Portfolio construction commonly favors holdings with low or negative correlation to each other, since that combination can reduce how much the portfolio moves as a whole. Rolling correlation lets a trader monitor whether that low-correlation assumption still holds, rather than relying on a single historical figure that may no longer reflect current conditions.
Hedge effectiveness
A hedge is only useful while it maintains the correlation (often negative) it was chosen for. Rolling correlation flags when a hedge instrument's relationship with the position it's meant to offset has weakened or reversed, which a one-time historical calculation would not show.
Pairs trading
Pairs and relative-value strategies commonly assume two historically correlated assets will remain correlated. A sustained drop in rolling correlation can be read as a signal that the underlying relationship the pair trade depends on is deteriorating, separate from any individual price signal.
Market-stress monitoring
Because normally weakly-correlated assets can show sharply rising correlation during broad market stress, informally described as correlations converging toward 1 during a crisis, some traders track rolling correlation across asset classes as one input among several for gauging whether markets are moving from a normal to a stressed regime. This is a commonly cited pattern, not a rule that holds in every downturn, and it should be read alongside other evidence rather than on its own.
Common Lookback Windows
| Window | Responsiveness | Common use |
|---|---|---|
| 30 days | Faster, noisier | Spotting a recent shift in relationship quickly |
| 60 days | Balanced | General-purpose portfolio and pairs monitoring |
| 90 days | Slower, smoother | Assessing a longer-term relationship |
There's no single correct window, a shorter window reacts faster to a genuine change in relationship but is also more likely to swing on a handful of unusual days, while a longer window smooths that noise at the cost of reacting more slowly to a real shift. Many traders compare more than one window rather than relying on a single setting.
Limitations
- Backward-looking. Every reading is calculated entirely from the returns already inside the current window, so it describes what already happened rather than predicting what happens next.
- Window-length sensitivity. A short window can swing sharply on a small number of large moves; a long window can mask a genuine recent shift in relationship for some time.
- Linear relationships only. The Pearson coefficient captures linear co-movement. Two assets can have a real but nonlinear relationship that rolling correlation understates or misses.
- No information about magnitude. Correlation describes whether two return series move in the same direction proportionally, not how large either asset's moves are, a high correlation says nothing about which asset is more volatile.
Common Mistakes
- Assuming a historical correlation stays constant going forward, correlation between two assets can and does change, particularly across different market regimes.
- Using one lookback window without testing sensitivity, a 30-day and a 90-day window can tell noticeably different stories about the same pair of assets.
- Treating correlation as causation, two return series moving together doesn't establish that one is driving the other.
- Confusing correlation with beta or volatility, correlation describes direction of co-movement only, not the relative size of each asset's moves.
- Relying on rolling correlation alone for diversification decisions, without checking how stable that correlation has been across different market regimes, a diversification assumption can quietly stop holding.
A Relationship That Changes With the Window You Measure It In
Rolling correlation reports how two series have moved together over a trailing window, and the choice of window length is not a detail. A short window responds quickly and reports noisy values; a long one is stable and slow to register a genuine change in the relationship. The same pair can appear correlated on one setting and independent on another.
The way to use it responsibly is to look at more than one window and report the range rather than a single number. Where short and long windows agree, the relationship is reasonably established. Where they disagree, the relationship is changing, and that is more useful to know than either figure alone.
The mistake is treating a correlation figure as a stable property for portfolio construction. Correlations between financial assets shift, and they have historically tended to shift toward each other during stressed periods, which is when a diversification assumption is being relied on most.
Correlation also measures only linear co-movement. Two series can be strongly related in a way this statistic reports as near zero, and a low reading is not evidence of independence.
Rolling Correlation FAQs
What does rolling correlation measure?
Rolling correlation measures how closely two assets' returns move together over a moving window, recalculated as the window shifts forward each period. It reveals whether that relationship is stable or changing over time, rather than reporting one fixed number for the entire history.
What lookback period is used for rolling correlation?
Commonly 30, 60, or 90 days, though the right window depends on the assets and the timeframe being analyzed. Shorter windows react faster to a recent shift; longer windows smooth out noise but respond more slowly to a genuine change in relationship.
Does a rolling correlation of 0 mean two assets are unrelated?
A reading of 0 means no linear relationship was detected over that specific window, it doesn't rule out a nonlinear relationship, and it can shift meaningfully once the window rolls forward to include new data.
Why does correlation rise during a market crisis?
During periods of broad market stress, assets that are normally weakly correlated can start moving together as selling pressure and risk-off flows affect many markets at once, informally described as correlations converging toward 1 during a crisis. This is a commonly observed pattern, not a fixed rule that holds in every downturn.
Is rolling correlation the same as beta?
No. Correlation measures how closely two return series move together on a scale of -1 to +1. Beta measures the magnitude of one asset's sensitivity to another, often a benchmark, which factors in relative volatility as well as correlation.
Can rolling correlation predict future correlation?
No. It's a backward-looking measure calculated entirely from historical returns over the chosen window. A stable historical correlation can still break down going forward, particularly during unusual market conditions.
Why can two assets show near-zero correlation while sharing the same underlying risk?
Correlation measures the consistency of co-movement across the whole window, so two assets driven by the same factor can register near zero if their responses differ in timing or if the factor was quiet during the window. It also measures only linear relationships. An exposure that appears only in extreme conditions is largely invisible to a correlation computed across ordinary periods.
How does the window length change the apparent stability of a correlation?
A short window produces a figure that swings widely as individual observations enter and leave, while a long window produces a stable figure that may average across two different regimes. Neither is more correct. Computing across several window lengths and treating disagreement as evidence of instability is more informative than selecting one and reporting it as the correlation.
Should correlation be computed on prices or on returns?
On returns. Two price series that both trend upward will show high correlation simply because both rose, regardless of whether their movements are related period to period. Returns remove that shared drift and measure co-movement directly. Correlation computed on price levels is one of the more common ways a spurious relationship gets reported as a strong one.
References
- CMT Association: Technical Analysis Body of Knowledge and Research
- CFA Institute Research and Policy Center: Investment Research
- TA-Lib: Technical Analysis Function Library Documentation
- The Pearson correlation coefficient, the statistical measure underlying rolling correlation, is a foundational concept in quantitative finance for describing the linear relationship between two data series.
- SEC Investor.gov: Introduction to Investing