Charts See the terminal

Correlation Coefficient

A line from -1 to +1 showing how closely this market's price has moved with another market's price over recent bars.

Comparison Add to chart

Live Correlation Coefficient preview · BTC/USDT · Binance

What is Correlation Coefficient?

The Correlation Coefficient measures how closely this market's price has tracked another market's over the last 20 bars, using the closing price by default. It reads +1 when the two move in lockstep, -1 when one mirrors the other, and near 0 when they are unrelated. By default the second market is ETH/USDT.

It correlates price levels, not bar-to-bar moves. Two markets that both trended up read close to +1 even if their daily moves had little in common. It does not say which market leads, or how large either move was.

How to use Correlation Coefficient

  • Near +1. The two prices have been rising and falling together over the window.
  • Near -1. When one has risen, the other has fallen.
  • Near 0. Over this window the two prices show no straight-line relationship.
  • Changes in the reading. A drop from a high reading to near zero means the two markets have started to go their own ways, which matters if you are treating them as a pair or a hedge.

Correlation describes the recent past. It does not guarantee the relationship will continue.

Settings

SettingDefaultWhat it changes
SymbolETH/USDT The market to compare against. It must trade on the same exchange as the chart. If it cannot be found, the line stays empty rather than showing a wrong value.
SourceClose Which price is compared, taken from both markets alike. Open, high, low and the averaged sources such as hl2 and hlc3 are also available.
Length20 Bars in the window. Shorter reacts quickly and swings widely; longer is steadier and slower to show a change in the relationship. Minimum 2.

Change the comparison market, price source and window in the indicator settings. Both markets are compared on the same price source.

Calculation

Pearson's correlation coefficient between the two markets' prices, their closes by default, over the last Length bars:

a = this market's price, b = the other market's price (same source)
r = sum((a - mean a) * (b - mean b))
    / sqrt(sum((a - mean a)^2) * sum((b - mean b)^2))

The result is always between -1 and +1, and a dashed line marks zero. The calculation uses a full window, so the first value appears once 20 bars of both markets are available.

Both markets are compared on the same price source, close by default. Where the other market has no bar, its previous bar is carried forward. If either price is perfectly flat across the window, the reading is undefined and no value is drawn.

Limitations

  • Trends inflate the reading. Any two markets that trended the same way score high, whether or not their day-to-day moves were related. Correlation - Log compares the moves instead.
  • It ignores size. A reading of +1 says the two moved together, not that they moved by the same amount.
  • Same exchange only. The comparison market must be listed on the chart's exchange.
  • It changes with the window. The same pair can read +0.9 over 20 bars and near 0 over 100.
  • The live candle moves. The current bar's value changes until that bar closes.

Frequently asked questions

It is a number from -1 to +1 that measures how closely two markets' prices have moved together over a recent window. +1 means they moved in lockstep, -1 means one mirrored the other, and 0 means no straight-line relationship.

The Correlation Coefficient compares price levels, so two markets that both trended up read high even if their individual moves were unrelated. Correlation - Log compares bar-to-bar percentage moves, which is closer to what most traders mean when they ask whether two markets move together.

Yes. The indicator declares three inputs: Symbol, default ETH/USDT; Source, default close, applied to both markets; and Length, default 20 with a minimum of 2. The symbol must trade on the same exchange as the chart. Open the indicator's settings on the chart to change them.

Values on bars that have already closed are not revised. The current bar's reading moves while either market's live candle is still open and settles when the bar closes.

Usually because the comparison market could not be found on the chart's exchange. Check the symbol is written as the exchange lists it, for example ETH/USDT, and that it trades there. The line also needs a full window of bars before it starts.

Add to chart