Rate of Change (ROC)

How far price has moved since n bars ago, relative to where it was: as a percent, a fraction or a ratio. How AlgoLift computes it and how to use it.

IndicatorBy AlgoLiftUpdated 3 min read
On this page 11What it measuresFormulaInputs in AlgoLiftOutputs in AlgoLiftHow to read itBest in, worst inThree setups1. Momentum threshold2. Zero-line cross3. Pullback inside momentumCommon mistakes

TL;DR. The change since n bars ago as a share of where price was then. A ROC of 2 means price is 2% above its level 10 bars back. Because it is a percent, the same threshold reads the same on ES at 6,000 and on a stock at 40.

What it measures

  • Momentum as a percent. How fast price is moving, scaled by its own level, so readings compare across instruments and across years.
  • Direction and speed at once. Above zero price is higher than it was; the size says by how much.
  • A fixed look back. Only two bars count: today's and the one n bars ago. Everything in between is ignored, which makes ROC quick and jumpy.

Formula

Inputs in AlgoLift

SettingDefaultRangeNotes
Period101 to 500How many bars back today's value is compared with.
UnitPercentPercent, Fraction, Ratio, Ratio x 100Percent and Fraction sit around 0, the ratios around 1 and 100. Pick the one your thresholds are written in.
SourceCloseClose, Open, High, Low, HL2, HLC3, OHLC4Which value of each bar is compared.

Outputs in AlgoLift

HandleTypePlottedNotes
ROCNumericAlwaysThe change since n bars ago in the chosen unit, drawn in its own panel around zero (or around 1 or 100 for the ratios).

How to read it

  • Above zero (Percent or Fraction): price is higher than n bars ago. Rising readings mean the climb is speeding up.
  • Below zero: the mirror. Falling readings mean the drop is speeding up.
  • Crossing zero: price has returned to its level of n bars ago. A cross from below is the simplest momentum turn.
  • Extremes: a reading far beyond its usual range is a stretched move, which can mean continuation in a trend or a snap back in a range. Measure the usual range on your own instrument first.
Common Misconception
Myth
ROC and the ROC Modifier are two names for the same thing.
Reality
The ROC Modifier turns any wired value into its change over n bars. This ROC indicator reads a bar's price directly, in TA-Lib's four units, and is the one to use when the rule is about price momentum itself.

Best in, worst in

Best in trending markets and breakout rules, where the question is whether price is moving fast enough to act on.

Worst in quiet ranges: ROC swings around zero and a zero-cross rule trades every wiggle. Add a trend or volatility filter.

Three setups

1. Momentum threshold

Use a Comparison to take longs only while ROC(10) is above 1 (price up more than 1% over 10 bars). Wire it into the Entry with your trigger. The threshold is a percent, so the same rule ports between instruments.

2. Zero-line cross

Add a Crossover node reading ROC(20) against a constant of 0: crossing above for longs, below for shorts. It fires once per cross, so one trade per turn.

3. Pullback inside momentum

Require ROC(50) above 0 (the longer move is up) and enter long when ROC(5) dips below 0 and turns back above it. The long ROC sets the direction, the short one times the entry.

Common mistakes

  • Mixing units. A threshold of 1 means 1% in Percent and 100% in Fraction. Write the rule in the unit the node is set to.
  • Reading one bar as a trend. ROC compares two bars only; a single spike n bars ago swings it on the way in and again on the way out. Smooth it or confirm it.
  • Tuning the period finely. If ROC(10) works and ROC(9) and ROC(11) fail, the edge is noise (overfitting in trading).
Key Takeaway

ROC is momentum as a percent of price: quick, comparable across instruments, and as noisy as the two bars it reads.