talib.roc

Rate of change of source measured across length bars. Where talib.change gives the difference, this gives the rate.

talib.roc(series float source, series int length) → series float
ParameterTypeRequiredDescription
sourceseries floatyesThe series to measure.
lengthseries intyesHow far back the measurement reaches.

Returns series float — A series float.

indicator("Rate of change")
plot(talib.roc(close, 9))

See also talib.alma · talib.atr · talib.barssince

Part of the function index.

Ready to put this into practice?
Try GoCharting Premium
Unlock advanced orderflow, market profile, options desk, and real-time data — everything you just read about, live in your charts.
Upgrade