Rolling Correlation

How closely two assets' daily returns move together, drawn over time: any coin, stock or cross-asset market against any other, with the current figure and where it sits in its own range.

CORRCORRELATIONCORAny two of: the cross-asset daily closes (crypto majors, US index and sector ETFs, Treasuries, commodities and FX, up to five years), any listed perp coin (two years), and every S&P 500 company and the 27 core names (the 27 stocks among the 45 US options names), one year.

CORR command showing the 120 day rolling correlation of BTC and SPY over 5 years, with its range, median and percentile

Typing it

CORR[A][B]window=lookback=
>CORRBTC NVDA window=90
Charts the 90 day correlation of BTC and NVDA over the default 1Y lookback, the year of daily bars a stock has here.

What you see

  • Line. The correlation of A and B over a trailing window, drawn across the lookback on a scale from -1 to +1, with a dashed line at zero.
  • Lookback average. A dotted line at one correlation over the whole lookback. Off until you press the button named after the lookback, such as 1Y avg, in the row above the chart.
  • STATS. Now: the current figure, its date, the returns in its window and a plain reading. Over the lookback: the range with the dates of the low and the high, the median, the current figure's percentile, and the whole-lookback figure with its returns. Data: where each asset's closes come from and the dates the pair shares.

How to read it

  • Scale. +1 is moving together, -1 moving opposite, 0 unrelated. The reading says Strong from 0.7 either side of zero, Moderate from 0.4, Weak from 0.2, and Little or no correlation below that.
  • Percentile. The share of the lookback's rolling figures at or below today's. 95 means the pair has rarely been this tied together over the period; 5 means rarely this loose.
  • Noise. At 60 returns a correlation near zero has a standard error of about 0.13, so a swing of a quarter on a short window can be chance.

What to look for

  • A pair leaving its usual range: a decoupling, or a change of regime.
  • Correlations jumping toward 1 across risk assets, which is what a liquidation looks like.
  • The rolling line far from the lookback average for weeks: the pair has changed character, and a hedge sized on the old figure is off.

Controls

A / B
The two assets, each picked with the asset picker: the cross-asset closes, Coins (Binance perps) and Stocks. With no pair typed, A is the panel's symbol or BTC, and B is SPY (BTC when A is SPY). Picking the other side's asset swaps the two, as does the ⇄ button between them.
Window
20D, 30D, 60D (the default), 90D or 120D of calendar days. window= in the command sets it, snapped to the nearest choice.
Lookback
6M, 1Y (the default), 2Y, 5Y or All, the whole history the pair has. lookback= takes 6m, 1y, 2y, 5y, all or a number of days.
1Y avg
Draws the whole-lookback correlation as a dotted line. Named after the lookback (6M avg, All avg and so on). Off by default.
STATS
Shows or hides the stats column.

Good to know

  • Pearson correlation of daily log returns, the same maths as CORRMAT, so the same pair and window give the same figure. A pair runs on the days both closed: BTC against a stock takes BTC's Friday to Monday move against the stock's, so the weekend counts and no Monday is dropped.
  • The window counts calendar days, so 60D is 60 returns for two coins and about 42 with a stock in it. Each rolling figure needs at least 10 returns in its window, the whole-lookback figure at least 20.
  • A typed name is looked up as a cross-asset market first, then a coin, then a stock. BTCUSDT and BTC-PERP read as BTC; SPX, NDX and RUT read as SPY, QQQ and IWM. On the free plan a coin reads a day late and a stock at the last close.

Pairs well with

CORRMATREGRSPREADPCARISKPAR

Questions

What is the difference between CORR and CORRMAT?

CORR is one pair of any two markets, with its own window and lookback, up to five years. CORRMAT is a matrix of the top coins or a cross-asset basket over the last year, and its Rolling view pairs only assets inside that matrix. Both use the same maths.

Can I correlate a coin with a stock?

Yes. Type both, such as CORR DOGE AAPL, or pick them in A and B. Any listed perp coin against any S&P 500 company or core name, on the days both closed.

Why is there no line?

A window needs at least 10 common returns and as many days of history as its length. A coin listed recently or a stock's single year can leave too little, and the panel says how many returns the pair shares. Try a shorter window or another pair.