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

ParameterTypeDefaultBounds or optionsDescription
Time Periodinteger101…100000Number of bars back used as the comparison point.

Outputs

OutputTypeDescription
ROCnumberRate 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

  1. Comparing different period/timeframe combinations as if they represented the same duration.
  2. Treating large magnitude as persistent momentum without regime context.
  3. Ignoring discontinuities caused by missing source history.
  4. 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.

Resources

Search documentation

Search across 46 documentation pages.