talib.correlation

Correlation between two series, source1 and source2, measured over length bars. Both series are ordinary arguments, so you can correlate anything a script can compute — not only prices.

talib.correlation(series float source1, series float source2, series int length) → series float
ParameterTypeRequiredDescription
source1series floatyesFirst of the two series being compared.
source2series floatyesSecond of the two series being compared.
lengthseries intyesHow many bars the measurement covers.

Returns series float — A series float correlation value.

indicator("Correlation of the close and the open")
plot(talib.correlation(close, open, 20))

See also talib.alma · talib.atr · talib.barssince

Part of the function index.

Ready to put this into practice?
Try GoCharting Premium
Unlock advanced orderflow, market profile, options desk, and real-time data — everything you just read about, live in your charts.
Upgrade