cTrader

AlgoWay Blog

Guides, manuals and platform references.

Core
JSON & Alerts
MT5 / Expert Advisors
Errors
Integrations
Other Publications
AlgoWay Strategy Lab

ROC Indicator: Why It Can Rise While Price Stays Flat

Conceptual flat price trace and rising ROC with changing historical reference points

The last three closing prices are identical, yet Rate of Change climbs through zero. There is no contradiction. ROC compares today's price with a moving historical reference, and that reference can fall while today's price stands still.

This matters when a TradingView automation rule treats rising ROC as a fresh burst of buying. Before connecting that condition to an order, decide whether you want a positive return over the lookback, an improving return, or a new rise in price. Those are three different tests. In an AlgoWay alert-execution workflow, define that event on the signal side before configuring the execution message.

The older price is part of the calculation

For a close-based ROC with length n, the calculation is 100 × (current close / close n bars ago - 1). TradingView's ROC documentation describes this percentage comparison. Length counts chart bars. The formula here assumes positive, nonzero reference prices.

Both ends of the comparison move forward with each new bar. It is tempting to watch only the newest candle, rather like judging a race by watching one runner and forgetting the other has legs.

A flat price can produce a rising ROC

Use a three-bar lookback and this invented sequence of closes: 110, 100, 90, 100, 100, 100. These are arithmetic examples, not backtest results.

BarCurrent closeClose three bars earlierThree-bar ROC
4100110-9.09%
51001000.00%
61009011.11%

At bar 4, 100 × (100 / 110 - 1) is about -9.09%. Two bars later, 100 × (100 / 90 - 1) is about 11.11%. The current close has not risen between those observations. A lower old price has entered the denominator.

The positive reading at bar 6 is still correct: 100 is 11.11% above the close three bars earlier. What would be incorrect is describing it as an 11.11% gain since bar 5. That one-bar return is zero.

The reverse also works. If the successive reference prices were 90, 100 and 110 while the current close remained 100, ROC would fall from 11.11% through zero to -9.09%. A falling oscillator need not mean the newest close fell.

Separate the level, the slope and the crossing

  • ROC above zero: with positive reference prices, the current close exceeds the close n bars earlier. This is a state that can remain true for many bars.
  • ROC greater than its previous value: the rolling percentage comparison improved. The example shows why that alone does not establish a new upward price move.
  • ROC crossing above zero: the previous reading was at or below zero and the new reading is positive. In the example, that event occurs at bar 6.

If your intended rule also requires a higher close than the immediately preceding bar, state that as a separate condition. The example would then fail the entry test despite its positive crossing. That is a change in strategy definition, not a correction to the indicator.

Likewise, a zero crossing in ROC has a different mathematical meaning from a MACD line or histogram zero crossing. Matching shapes on a chart do not make the conditions interchangeable.

Check the two prices before changing an alert

When an ROC alert looks surprising, record the chart symbol, timeframe, length, source, current source value and value n bars earlier. Recalculate the ratio. If those values explain the reading, the next question is whether the rule describes the event you meant to trade.

For a rule defined on completed closes, configure evaluation at bar close. TradingView documents the distinction between per-bar and bar-close alert frequencies in its Pine alert guide. Waiting for the close fixes the observation time; it does not remove the moving-base effect.

Running TradingView script alerts retain a saved copy of their script and inputs. After changing the lookback or condition, follow the guide to replacing alerts with updated settings so the running alert matches the rule you reviewed.

A useful dry-run record contains the two prices and the resulting ROC alongside each signal. It lets you distinguish an arithmetic surprise from an execution problem before changing order size, stops or routing. ROC can tell you where price stands relative to an older bar. It cannot, by itself, tell you why it got there.

Last updated: October 24, 2026