Momentum indicators
Rate of Change
Percentage change from a prior close over a fixed period.
- Engine
- TA-Lib
- Function
ROC- Input series
- close
- Outputs
- 1
How it works
ROC compares the current close to the close from the configured number of bars earlier and returns the percentage change.
Use case
Use ROC as a direct momentum feature that captures relative price change over a configurable lookback period.
Parameters
| Parameter | Type | Default | Bounds or options | Description |
|---|---|---|---|---|
| Time Period | integer | 10 | 1…100000 | Number of bars back used as the comparison point. |
Outputs
| Output | Type | Description |
|---|---|---|
| ROC | number | Rate of Change value for the bar. |
Reading the result
Rate of Change compares the current close with an earlier close at the configured horizon. Positive and negative values describe direction over that interval, while magnitude describes the size of the relative move.
It is a fixed-horizon comparison, not a rolling average of one-bar returns. Changing the timeframe or period changes the elapsed market horizon represented by the feature.
Common mistakes
- Comparing different period/timeframe combinations as if they represented the same duration.
- Treating large magnitude as persistent momentum without regime context.
- Ignoring discontinuities caused by missing source history.
- Mixing percentage-point interpretation with decimal-return conventions in downstream code.
DataCat workflow notes
Confirm the generated output description and scale before combining ROC with returns calculated by another library. Preserve the original DataCat column and document any rescaling performed downstream.