Skip to content
Algo Trade Analytics Docs

ta.roc() - Pine Script Function

Calculates the percentage of change (rate of change) between the current value of source and its value length bars ago.

ta.roc(source, length) → series float
NameTypeDescription
sourceseries int/floatSeries of values to process.

The rate of change of source for length bars back.

  • na values in the source series are included in calculations and will produce an na result.