ta.correlation() - Pine Script Function
ta.correlation()
Section titled “ta.correlation()”Overview
Section titled “Overview”Correlation coefficient. Describes the degree to which two series tend to deviate from their ta.sma values.
Syntax
Section titled “Syntax”ta.correlation(source1, source2, length) → series floatParameters
Section titled “Parameters”| Name | Type | Description |
|---|---|---|
| source1 | series int/float | Source series. |
Returns
Section titled “Returns”Correlation coefficient.
Remarks
Section titled “Remarks”- na values in the source series are ignored; the function calculates on the length quantity of non-na values.