Charts See the terminal

Correlation - Log

A line from -1 to +1 showing how closely this market's bar-to-bar moves have matched another market's over recent bars.

Comparison Add to chart

Live Correlation - Log preview · BTC/USDT · Binance

What is Correlation - Log?

Correlation - Log measures how closely this market's bar-to-bar moves have matched another market's over the last 25 bars. It compares log returns, the proportional change from one close to the next, so it answers whether the two markets tend to rise and fall on the same bars. By default the second market is ETH/USDT.

It does not say which market leads, how large the moves were, or whether the relationship will last. A high reading describes the window it covers.

How to use Correlation - Log

  • Near +1. The two markets have tended to move up and down on the same bars.
  • Near -1. When one has moved up, the other has tended to move down.
  • Near 0. Their bar-to-bar moves have been unrelated over the window, even if both trended the same way.
  • A falling reading. Two markets that usually move together starting to decouple is often what pair traders and hedgers want to know first.

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.
Length25 Bars of returns in the window. Shorter reacts quickly and is noisier; longer is steadier and slower to show a change. Minimum 2.

Change the comparison market and window in the indicator settings. Both markets are compared on their closing prices.

Calculation

Each bar, both markets' log returns are taken, then Pearson's correlation is calculated over the last Length of them:

a = ln(close / previous close)          for this market
b = ln(other close / previous other close)
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. A return needs the previous bar, so the first value appears one bar later than it would on prices: after 26 bars with the default length of 25.

Where the other market has no bar, its previous close is carried forward, which counts as a zero return for that bar.

Limitations

  • It ignores size. Two markets can read +1 while one moves twice as far as the other.
  • Same exchange only. The comparison market must be listed on the chart's exchange.
  • It depends on the timeframe. Markets that move together on 1D can look much less related on 1m, where small moves are mostly noise.
  • Gaps lower the reading. Bars where the other market did not trade count as no move, pulling the correlation towards zero.
  • The live candle moves. The current bar's value changes until that bar closes.

Frequently asked questions

It is the correlation between two markets' log returns, a number from -1 to +1 that measures how closely their bar-to-bar moves have matched over a recent window. +1 means they rose and fell together, -1 means opposite moves, 0 means unrelated moves.

The [Correlation Coefficient](/library/indicator/correlation-coefficient) compares price levels, so two markets that both trended up read high even when their individual moves were unrelated. Correlation - Log compares the moves themselves, so a shared trend alone does not push it towards +1.

Yes. The indicator declares two inputs: Symbol, default ETH/USDT, and Length, default 25 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 and that it trades there. The line also needs one bar more than the length before it starts.

Use the Add to chart button at the top of this page. It opens BTC/USDT on Binance in the Altrady Charts terminal with the built-in Correlation - Log already applied. On any other market, open the indicator picker on the chart and choose Correlation - Log from the Comparison group.

Add to chart