◆ New — Strategy Validator, Code Fixer & Prop Compliance Checker are live. Try one free →
Home / Indicators / Rate of Change (ROC)
Momentum indicator

Rate of Change (ROC)

A momentum oscillator that measures the percentage change in price over a set number of bars.

Illustrative diagram — not live market data.

What it is

Rate of Change (ROC) is a momentum oscillator that measures how much price has changed, in percentage terms, over a chosen lookback period. It plots as a single line that oscillates above and below a zero line. A positive reading means the current price is higher than it was N bars ago; a negative reading means it is lower. Because the output is a percentage rather than a raw price, ROC lets you compare momentum across different instruments and timeframes on a consistent scale. It is purely descriptive math applied to past prices and does not forecast future direction.

How it works

ROC compares the current closing price to the closing price a fixed number of bars ago and expresses the difference as a percentage. The standard formula is: ROC = ((Close - Close N bars ago) / Close N bars ago) * 100, where N is the lookback length. With a length of 9, for example, each bar's ROC value reflects the percentage change between the current close and the close nine bars earlier. The line crosses zero whenever the current close equals the close N bars ago. As the lookback period gets shorter, ROC reacts faster and is noisier; as it gets longer, it smooths out and responds more slowly. Some platforms label a closely related calculation as Momentum, which shows the raw price difference rather than the percentage; ROC is the normalized, percentage-based version.

How traders read it

Common settings

A lookback length of 9, 10, 12, or 14 bars is common, plotted against a zero line in a separate pane. Shorter lengths (for example 5-9) react faster and are noisier; longer lengths (for example 20-25 or more) are smoother and slower. The source is usually the close. Choice of length and source is a personal, market-dependent preference, not a recommendation.

Strengths

Pitfalls to watch

Pine v6 example

//@version=6
indicator("Rate of Change (ROC)", overlay = false)

length = input.int(9, "Length", minval = 1)
src    = input.source(close, "Source")

roc = ta.roc(src, length)

plot(roc, "ROC", color = color.blue)
hline(0, "Zero", color = color.gray, linestyle = hline.style_dashed)

Pro tip: Because ROC has no fixed scale, it helps to first observe how far a specific market and timeframe typically travels from zero before reading any value as large or small. A reading that looks extreme on a calm pair may be ordinary on a volatile one. Treat it as context about past behavior, never as a signal to act, and remember trading carries a risk of loss.

Built an indicator from this? Run it through the Validator to catch look-ahead bias and repainting, or convert a strategy to Pine Script.

Educational only — not financial advice, not a recommendation to trade. No indicator is predictive; trading involves substantial risk of loss.

Catch the bug that compiles.Run auditGet Pro