correlation
forge.tafunctionSince Forge API 1
Signaturepython
forge.ta.correlation(a: ArrayLike,b: ArrayLike,period: int = 30) -> np.ndarrayRolling correlation of two series over the last period bars, from -1 to 1.
Parameters
| Name | Type | Default |
|---|---|---|
| a | ArrayLike | |
| b | ArrayLike | |
| period | int | 30 |
A window where either series is missing a value or does not move has no value. The two series
can come from two symbols aligned on the same bars: d["GBPUSD"].close in a strategy, or a
declared second symbol in an indicator. Example: ta.correlation(close, other, 30).