ta.correlation
Pearson correlation coefficient of a and b over length bars, -1 to 1.
ta.correlation(a: float, b: float, length: simple int) -> series float
Parameters
afloat: The first series.bfloat: The second series.lengthsimple int: Number of bars, a whole number from 1 to 5000 (a fraction is cut off). Known before the first bar: a literal or an input, never a series. Outside 1 to 5000 the script stops with a runtime error.
Example
ta.correlation(close, volume, 20)