Rate of Change measures the percentage change between the current
close and the close period bars ago.
Formula
roc = 100 * (close[t] - close[t-N]) / close[t-N]Params
period- lookback in bars. Required.
Output
Single column named after your indicator (e.g. 12-bar ROC).
Usage
- Momentum filter: only take longs when
roc > 0over a chosen window. - Mean reversion: extreme positive or negative ROC readings can flag exhaustion. Pair with overbought / oversold conditions.
- Regime tag: build a custom trend with
roc_60 > 5as bull androc_60 < -5as bear.
ROC vs Momentum
Momentum measures the absolute price difference, ROC measures the percentage. ROC is scale-invariant - comparable across symbols with very different prices.
Pitfalls
ROC is reactive but unbounded - a 50% bar will produce a 50% ROC
spike that takes period bars to flush. Don't use raw ROC values
as price-anchored thresholds without normalizing for the symbol's
volatility.
