ta.roc() - Pine Script Function
ta.roc()
Section titled “ta.roc()”Overview
Section titled “Overview”Calculates the percentage of change (rate of change) between the current value of source and its value length bars ago.
Syntax
Section titled “Syntax”ta.roc(source, length) → series floatParameters
Section titled “Parameters”| Name | Type | Description |
|---|---|---|
| source | series int/float | Series of values to process. |
Returns
Section titled “Returns”The rate of change of source for length bars back.
Remarks
Section titled “Remarks”- na values in the source series are included in calculations and will produce an na result.