Guides, manuals and platform references.
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.
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.
Use a three-bar lookback and this invented sequence of closes: 110, 100, 90, 100, 100, 100. These are arithmetic examples, not backtest results.
| Bar | Current close | Close three bars earlier | Three-bar ROC |
|---|---|---|---|
| 4 | 100 | 110 | -9.09% |
| 5 | 100 | 100 | 0.00% |
| 6 | 100 | 90 | 11.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.
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.
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.