# ROC-of-ROC

ROC-of-ROC is an indicator on [Vela](https://vela.luxalgo.com/chart), our next-generation charting platform, written in Pine Script®.

ROC-of-ROC plots the second derivative of price: a 9-bar percent rate of change differenced again over 9 bars, with SMA smoothing applied to the output (3 bars by default). The acceleration line is colored by a four-state read - advance or decline, accelerating or decelerating - above a velocity context line, and alerts flag zero crosses and the bar a move first starts decelerating.

- Indicator in the LuxAlgo Library, by LuxAlgo, published Jun 19, 2026.
- Access: free.
- Concepts: [ROC-of-ROC](https://www.luxalgo.com/library/concept/roc-of-roc/) (primary)
- Open on Vela: https://vela.luxalgo.com/chart?pineScriptCodeId=lss7pld2vdubvpk0iwp6djzv
- Page: https://www.luxalgo.com/library/indicator/roc-of-roc/

**ROC-of-ROC** plots the acceleration of price: a 9-bar percent rate of change (velocity) differenced again over 9 bars. The line runs positive while momentum is still building and turns negative once it starts to fade, often while price is still pressing on. The definitive clean build of [ROC-of-ROC](https://www.luxalgo.com/library/concept/roc-of-roc/) takes the second pass as a difference rather than a percent change and colors the acceleration line by a four-state read: advance or decline from velocity's sign, accelerating or decelerating from acceleration's.

## How to Trade the ROC-of-ROC?

- **Zero crosses**: acceleration crossing above zero says momentum stopped decaying and started building; crossing below says the opposite, both arriving before momentum itself crosses zero.
- **Deceleration warnings**: velocity positive with acceleration negative is an advance still rising but losing thrust, a cue to tighten risk, not an automatic reversal call. The mirrored state is an early basing cue.
- **Velocity context**: read the acceleration sign against the velocity line; agreement is thrust, a split is the early warning.

Four alerts cover both zero crosses and the first bar of each deceleration state; optional circles mark those bars.

## ROC-of-ROC Settings

- **Source** (default close): series both derivatives run on.
- **Velocity Length** (default 9): lookback of the first rate of change.
- **Acceleration Length** (default 9): bars over which the change in velocity is measured.
- **Method** (default SMA): average type used by both smoothing steps.
- **Source Smoothing** (default 1): pre-smoothing of the source; 1 keeps the textbook construction.
- **Acceleration Smoothing** (default 3): smoothing on the final line, filtering false starts around zero.
- **Velocity Context Line** (default enabled), **Deceleration Warning Markers** (default disabled), **Gradient Fill** (default enabled); Style colors set the four states.

## Frequently Asked Questions

### How is this different from a plain Rate of Change?

By one derivative. [Rate of Change](https://www.luxalgo.com/library/indicator/rate-of-change/) measures how fast price is moving; ROC-of-ROC asks whether that speed is building or fading. The second derivative turns earlier, and pays for that lead in noise, hence the default output smoothing.

### Why is the second pass a difference instead of a percent change?

Velocity crosses zero, and a percent change of a series near zero divides by tiny numbers, producing unstable readings. The difference form keeps the acceleration line well-behaved through momentum flips.

### Should the deceleration warnings be traded on their own?

Treat them as context: they say thrust is fading, not that price reverses here. Pair them with structure or a slower momentum gauge before acting.

## Related indicators

- [LTF Momentum Projection](https://www.luxalgo.com/library/indicator/ltf-momentum-projection/) (Momentum): markdown at https://www.luxalgo.com/library/indicator/ltf-momentum-projection.md
- [Rubber Band Liquidity Signals](https://www.luxalgo.com/library/indicator/rubber-band-liquidity-signals/) (Disparity Index): markdown at https://www.luxalgo.com/library/indicator/rubber-band-liquidity-signals.md
- [Moving Averages Proximity Oscillator](https://www.luxalgo.com/library/indicator/moving-averages-proximity-oscillator/) (Disparity Index): markdown at https://www.luxalgo.com/library/indicator/moving-averages-proximity-oscillator.md
- [Candle Breakout Oscillator](https://www.luxalgo.com/library/indicator/candle-breakout-oscillator/) (Momentum): markdown at https://www.luxalgo.com/library/indicator/candle-breakout-oscillator.md
- [Adaptive Momentum Oscillator](https://www.luxalgo.com/library/indicator/adaptive-momentum-oscillator/) (Momentum): markdown at https://www.luxalgo.com/library/indicator/adaptive-momentum-oscillator.md
- [Momentum Cycle Sentry](https://www.luxalgo.com/library/indicator/momentum-cycle-sentry/) (Momentum): markdown at https://www.luxalgo.com/library/indicator/momentum-cycle-sentry.md
- [Momentum Terrain 3D](https://www.luxalgo.com/library/indicator/momentum-terrain-3d/) (Momentum): markdown at https://www.luxalgo.com/library/indicator/momentum-terrain-3d.md
- [Triangular Momentum Oscillator & Real Time Divergences](https://www.luxalgo.com/library/indicator/triangular-momentum-oscillator-real-time-divergences/) (Momentum): markdown at https://www.luxalgo.com/library/indicator/triangular-momentum-oscillator-real-time-divergences.md

---

Source: https://www.luxalgo.com/library/indicator/roc-of-roc/ (LuxAlgo Library). Free to use with attribution: https://www.luxalgo.com/library/license/
