- **Similar:** [ROCP](../rocp/Rocp.md), [MOM](../mom/Mom.md) | **Complementary:** Moving average for smoothing | **Trading note:** Rate of Change; percentage price change over n periods. Unbounded oscillator.
ROC (Rate of Change) calculates the absolute price difference between the current value and the value N periods ago. This is the most basic form of momentum measurement, returning the raw price change in the same units as the input data. Unlike ROCP (percentage) or ROCR (ratio), ROC preserves the original scale, making it directly interpretable in dollar/point terms.
## Historical Context
ROC belongs to the earliest class of technical indicators, predating computerized analysis. Traders have always measured "how much has price moved" as a fundamental question. The absolute form (current - past) appears in technical analysis literature under various names: momentum, price change, and rate of change. The terminology varies by platform and library:
- **TA-Lib**: Uses `MOM` (Momentum) for absolute change
- **Tulip**: Uses `MOM` for absolute change
- **TradingView/PineScript**: Uses `ROC` for absolute change in this codebase
- **QuanTAlib**: Uses `ROC` for absolute change, `CHANGE` for percentage
This implementation follows the PineScript convention where ROC represents the absolute difference.
## Architecture & Physics
### 1. Ring Buffer Storage
The indicator maintains a sliding window of `period + 1` values:
6.**API confusion**: QuanTAlib's `CHANGE` indicator returns percentage (decimal), while `ROC` returns absolute change. This differs from some platforms where ROC means percentage.
## References
- Pring, M. J. (2014). "Technical Analysis Explained." McGraw-Hill.
- Murphy, J. J. (1999). "Technical Analysis of the Financial Markets." New York Institute of Finance.