Rate of Change (ROC)
Measures the percentage change in price between consecutive periods.
About the Rate of Change (ROC)
The Rate of Change (ROC) is a momentum oscillator that measures the percentage change in price between consecutive periods. It directly shows the speed at which prices are changing, providing a pure measurement of price velocity without smoothing or additional calculations. ROC oscillates above and below a zero line, with positive values indicating upward momentum and negative values indicating downward momentum.
Developed as one of the earliest momentum indicators, ROC is calculated simply by comparing each price to the previous period's price. Its simplicity makes it an excellent educational tool for understanding momentum concepts while remaining a valuable component in many trading strategies and technical analysis systems.
What It Measures
Rate of Change measures the velocity of price movement by calculating the percentage difference between consecutive prices. This provides a direct, unfiltered view of period-to-period price acceleration or deceleration, making it particularly useful for identifying immediate momentum shifts.
When to Use
- Identify Momentum Shifts: Positive ROC values indicate upward momentum, while negative values suggest downward momentum
- Spot Divergences: When price makes new highs but ROC fails to confirm, it may signal weakening momentum
- Overbought/Oversold Conditions: Extreme ROC values (significantly above/below zero) can indicate stretched conditions
- Trend Confirmation: ROC crossing above zero can confirm uptrends; crossing below zero can confirm downtrends
- Comparison Across Timeframes: ROC's percentage-based calculation allows meaningful comparison across different price levels
- Pure Velocity Measurement: Unlike smoothed indicators, ROC shows raw period-to-period changes
Interpretation
- Zero Line: The centerline dividing positive (upward) and negative (downward) momentum
- Positive Values: Indicate the current price is higher than the previous period, suggesting upward momentum
- Negative Values: Indicate the current price is lower than the previous period, suggesting downward momentum
- Magnitude: Larger absolute values indicate stronger momentum; values near zero suggest consolidation or minimal price movement
- Crossovers: ROC crossing above zero signals bullish momentum; crossing below zero signals bearish momentum
- Divergences: When price makes new highs/lows but ROC doesn't follow, it may indicate momentum weakness and potential reversal
- Extreme Values: Very high or low ROC values can indicate overbought or oversold conditions, though specific thresholds vary by asset and timeframe
- No Smoothing: ROC reflects raw period-to-period changes without averaging, making it highly responsive to price movements
Example Usage
use centaur_technical_indicators::momentum_indicators::bulk::rate_of_change;
pub fn main() {
// fetch the data in your preferred way
// let prices = vec![...]; // price data
let roc = rate_of_change(&prices);
println!("Rate of Change: {:?}", roc);
}
import centaur_technical_indicators as cti
# Calculate Rate of Change
roc = cti.momentum_indicators.bulk.rate_of_change(prices)
print("Rate of Change:", roc)
import init, {
momentum_bulk_rateOfChange
} from 'https://cdn.jsdelivr.net/npm/centaur-technical-indicators@latest/dist/web/centaur-technical-indicators.js';
await init();
// fetch the data in your preferred way
// const prices = [...]; // price data
const roc = momentum_bulk_rateOfChange(prices);
console.log("Rate of Change:", roc);