Rate Of Change
systemic:core-rocIndicatorsfunction1 crInputs
| Name | Type | Description |
|---|---|---|
| Window | integer | The number of periods over which to measure price change. This determines the "$n$" in the ROC formula: |
| Price | floatarray | The price series from which to calculate the Rate of Change. This input accepts any numerical sequence representing asset values over time. |
Outputs
| Name | Type | Description |
|---|---|---|
| ROC | floatarray | The ROC output is a time series of percentage values representing momentum at each point. |
The Rate of Change indicator measures momentum by calculating the percentage change between the current price and the price periods ago. It's one of the simplest yet most effective momentum oscillators, answering the fundamental question: "How fast is price moving?"
How ROC Works
flowchart LR
subgraph Input["Price Data"]
Pt["Current Price<br/>P(t)"]
Ptn["Price n periods ago<br/>P(t-n)"]
end
subgraph Calc["ROC Calculation"]
Diff["P(t) - P(t-n)"]
Div["Divide by P(t-n)"]
Mult["Multiply by 100"]
end
subgraph Output["Momentum"]
Pos["ROC > 0<br/>Bullish"]
Zero["ROC = 0<br/>Flat"]
Neg["ROC < 0<br/>Bearish"]
end
Pt & Ptn --> Diff --> Div --> Mult --> Pos & Zero & Neg
Interpretation
| ROC Value | Meaning |
|---|---|
| Positive and rising | Accelerating upward momentum |
| Positive and falling | Upward momentum slowing |
| Zero crossing up | Momentum turning bullish |
| Zero crossing down | Momentum turning bearish |
| Negative and falling | Accelerating downward momentum |
| Negative and rising | Downward momentum slowing |
Trading Strategies
1. Zero-Line Crossover
flowchart TD
ROC["ROC Value"] --> Cross{"Crossing zero?"}
Cross -->|"Up through 0"| Buy["Bullish Signal"]
Cross -->|"Down through 0"| Sell["Bearish Signal"]
Cross -->|"No"| Hold["Hold"]
2. Overbought/Oversold
While ROC is unbounded, extreme readings often precede reversals:
| Condition | Signal |
|---|---|
| ROC at historical highs | Potential overbought |
| ROC at historical lows | Potential oversold |
3. Divergence Trading
| Price | ROC | Signal |
|---|---|---|
| Higher high | Lower high | Bearish divergence |
| Lower low | Higher low | Bullish divergence |
Period Selection
| Period | Characteristics | Best For |
|---|---|---|
| 5-10 | Very sensitive, many signals | Day trading, scalping |
| 12-14 | Balanced (common default) | Swing trading |
| 20-30 | Smooth, fewer false signals | Position trading |
| 50+ | Very smooth, major trends only | Long-term analysis |
ROC vs. Momentum Indicator
ROC and the Momentum indicator are closely related:
| Indicator | Formula | Scale |
|---|---|---|
| ROC | Percentage | |
| Momentum | Absolute points |
Advantage of ROC: The percentage scale allows comparison across different assets with different price levels.
Building Systems with ROC
Momentum Confirmation System
flowchart TD
subgraph Data["Input"]
Price["Close Prices"]
end
subgraph Indicators["Indicators"]
SMA["SMA(50)"]
ROC["ROC(12)"]
end
subgraph Conditions["Conditions"]
Trend["Price > SMA"]
Mom["ROC > 0"]
AND["AND"]
end
subgraph Signal["Output"]
Buy["Buy Signal"]
end
Price --> SMA & ROC
SMA --> Trend
ROC --> Mom
Trend & Mom --> AND --> Buy
This system requires both:
- Price above 50-day moving average (uptrend)
- ROC positive (positive momentum)
The KST Connection
ROC is the building block for the Know Sure Thing (KST) indicator, which smooths and weights multiple ROC periods:
This multi-timeframe approach filters noise while capturing momentum across different cycles.
Missing Data
A gap (no datapoint for a period — e.g. a closed-market weekend on a daily series) is never treated as "unchanged" or carried forward: ROC compares each price only against its -observed-bar lookback, so a gap is bridged (Friday's close is the lookback for the first bar after the weekend) rather than stretching the window to a fixed calendar span. Gaps produce None, never a fabricated 0 or a stale repeated value.
Edge Cases
| Situation | Result |
|---|---|
| First observed bars | None (insufficient lookback data) |
| (genuine zero price) | None (division by zero is undefined, not laundered) |
| Negative prices | Mathematically valid but rare in practice |
Advantages
- Simple — Easy to understand and calculate
- Normalized — Percentage allows cross-asset comparison
- Leading indicator — Can signal momentum shifts before price reversals
- Versatile — Works on any timeframe and asset class
Disadvantages
- No bounds — Unlike RSI, no fixed overbought/oversold levels
- Whipsaws — Frequent zero-line crosses in ranging markets
- Single-period — Only compares two points, ignoring intermediate action
Indicator Assessment
%%{init: {"quadrantChart": {"titleFontSize": 14}, "themeVariables": {"quadrant1Fill": "#e8f5e9", "quadrant2Fill": "#fff3e0", "quadrant3Fill": "#ffebee", "quadrant4Fill": "#e3f2fd"}}}%%
quadrantChart
title Rate of Change Assessment
x-axis Low Popularity --> High Popularity
y-axis Low Reliability --> High Reliability
quadrant-1 High potential
quadrant-2 Established
quadrant-3 Niche
quadrant-4 Widely used
Stocks: [0.75, 0.65]
Crypto: [0.70, 0.55]
| Dimension | Stocks | Crypto | Explanation |
|---|---|---|---|
| Popularity | 7.5/10 | 7.0/10 | Foundational momentum indicator; widely taught and referenced across all markets |
| Reliability | 6.5/10 | 5.5/10 | Simple and effective, but prone to whipsaws; slightly less reliable in crypto's volatility |
| Complexity | 2/10 | 2/10 | Extremely simple calculation — just percentage change between two points |
| Versatility | 9/10 | 8/10 | Works on any timeframe, any asset; building block for more complex indicators like KST |
| Recent Interest | 5/10 | 5/10 | Classic indicator with stable, consistent usage; no recent resurgence but never out of favor |
Key Insight: ROC's simplicity is both its strength and limitation. It's the purest expression of momentum — no smoothing, no weighting, just raw percentage change. This makes it an excellent building block for more sophisticated systems (like KST which uses four weighted ROC periods). For direct use, consider pairing with a trend filter to reduce false signals in ranging markets.