Systemicalpha

Rate Of Change

systemic:core-rocIndicatorsfunction1 cr

Inputs

NameTypeDescription
WindowintegerThe number of periods over which to measure price change. This determines the "$n$" in the ROC formula:
PricefloatarrayThe price series from which to calculate the Rate of Change. This input accepts any numerical sequence representing asset values over time.

Outputs

NameTypeDescription
ROCfloatarrayThe 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 nn periods ago. It's one of the simplest yet most effective momentum oscillators, answering the fundamental question: "How fast is price moving?"

ROC=Pt−Pt−nPt−n×100ROC = \frac{P_t - P_{t-n}}{P_{t-n}} \times 100

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 ValueMeaning
Positive and risingAccelerating upward momentum
Positive and fallingUpward momentum slowing
Zero crossing upMomentum turning bullish
Zero crossing downMomentum turning bearish
Negative and fallingAccelerating downward momentum
Negative and risingDownward 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:

ConditionSignal
ROC at historical highsPotential overbought
ROC at historical lowsPotential oversold

3. Divergence Trading

PriceROCSignal
Higher highLower highBearish divergence
Lower lowHigher lowBullish divergence

Period Selection

PeriodCharacteristicsBest For
5-10Very sensitive, many signalsDay trading, scalping
12-14Balanced (common default)Swing trading
20-30Smooth, fewer false signalsPosition trading
50+Very smooth, major trends onlyLong-term analysis

ROC vs. Momentum Indicator

ROC and the Momentum indicator are closely related:

IndicatorFormulaScale
ROC(Pt−Pt−n)/Pt−n×100(P_t - P_{t-n}) / P_{t-n} \times 100Percentage
MomentumPt−Pt−nP_t - P_{t-n}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:

  1. Price above 50-day moving average (uptrend)
  2. 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:

KST=w1⋅SMA(ROC1)+w2⋅SMA(ROC2)+w3⋅SMA(ROC3)+w4⋅SMA(ROC4)KST = w_1 \cdot SMA(ROC_1) + w_2 \cdot SMA(ROC_2) + w_3 \cdot SMA(ROC_3) + w_4 \cdot SMA(ROC_4)

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 nn-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

SituationResult
First nn observed barsNone (insufficient lookback data)
Pt−n=0P_{t-n} = 0 (genuine zero price)None (division by zero is undefined, not laundered)
Negative pricesMathematically 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]
DimensionStocksCryptoExplanation
Popularity7.5/107.0/10Foundational momentum indicator; widely taught and referenced across all markets
Reliability6.5/105.5/10Simple and effective, but prone to whipsaws; slightly less reliable in crypto's volatility
Complexity2/102/10Extremely simple calculation — just percentage change between two points
Versatility9/108/10Works on any timeframe, any asset; building block for more complex indicators like KST
Recent Interest5/105/10Classic 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.


Further Reading

Rendering diagrams...
© 2026 WanoLabs. All rights reservedAlpha build v0.1.5