Skip to content
StatePath
Tool Atlascalc.correlation

Tool

Rolling Correlation

calc.correlation

CalculationStatistic

Inputs

aBuffer (time series)

The first number line to correlate (e.g. the symbol you trade).

bBuffer (time series)

The second number line to compare against the first (e.g. a related symbol or index).

Outputs

Buffer (time series)

A line bounded between −1 and +1: above 0 the two series move together, below 0 they move oppositely, near 0 they are unrelated.

Rolling Correlation measures how closely two number lines move together over a sliding window, reporting a value from −1 to +1. Near +1 they rise and fall in step; near −1 one rises while the other falls; near 0 they barely relate.

Rolling Correlation overview diagram

How it works

On every bar it takes the last `period` values of inputs `a` and `b` and computes their Pearson correlation coefficient — the standardized co-movement of the two windows. A longer `period` smooths the reading and reacts slowly; a shorter one tracks recent shifts but jumps around.

Configuration

periodscalar

How many bars of each series the correlation looks back over. Larger gives a steadier, slower reading; smaller reacts faster but is noisier. A common starting point is 20–50 bars.

period diagram

Connects to

Reads from
Feeds into

Examples

  • Risk filter: block a new EURUSD long when its 50-bar correlation with GBPUSD is above 0.8, so you don’t double up on the same bet.
  • Pairs setup: watch for the correlation between two normally-linked symbols to drop sharply, hinting the pair has decoupled.

Common mistakes

  • Reading correlation as cause — two series can move together by coincidence or because both follow a third driver, not because one moves the other.
  • Using too short a period, which makes the value flip between +1 and −1 on noise and gives a false sense of a stable relationship.

See also