ROC Divergence Pass Node

Rate of Change Divergence — Series Input

MomentumDivergencePass

Overview

The ROC Divergence Pass Node detects momentum divergence on a series input using Rate of Change. It compares the ROC of current price to prior ROC peaks and troughs — flagging divergence when price and momentum move in opposing directions.

Divergence detection is one of the most powerful early warning tools in technical analysis. When price makes a new high but ROC makes a lower high (bearish divergence), momentum is deteriorating even as price advances — often preceding a reversal. Conversely, bullish divergence signals potential bottoms.

Formula

ROC[i] = (close[i] − close[i−period]) / close[i−period] × 100
Divergence detected when:
• price[i] > price[i−period] AND ROC[i] < ROC[i−period] → bearish divergence (−1)
• price[i] < price[i−period] AND ROC[i] > ROC[i−period] → bullish divergence (+1)
• otherwise → 0 (no divergence)
Output: discrete signal values {-1, 0, +1}. Warm-up: 2 × period bars.

Parameters

ParameterDefaultDescription
period14Lookback period for ROC calculation and divergence comparison

Inputs & Outputs

SlotDirectionTypeDescription
inputInput{ values, timestamps }Price or any numeric series
valuesOutput(number | null)[]Divergence signal: +1 bullish, −1 bearish, 0 none; nulls during warm-up
timestampsOutputnumber[]Unix timestamps aligned to input

Use Cases

Automated Divergence Detection

Automate the manual process of identifying divergence on charts — the node outputs a signal directly when divergence conditions are met, enabling systematic divergence-based strategies.

Trend Reversal Early Warning

Bearish divergence (−1) at price highs warns that upward momentum is weakening. Bullish divergence (+1) at price lows signals that downward momentum is fading — both precede many reversals.

Multi-Timeframe Confirmation

Run ROC Divergence on multiple timeframes simultaneously. When divergence appears on daily and weekly charts at the same time, the reversal probability is substantially higher than on a single timeframe.

Tips & Best Practices

Confirm with Price Action

Divergence signals alone are not sufficient for entries — confirm with a price action trigger (break of support/resistance, candlestick reversal pattern) before acting on the divergence signal.

Divergence in Strong Trends

In strong trends, bearish divergence can persist for many bars before a reversal occurs. Use a trend filter — only trade counter-trend divergence signals when the trend is mature or exhausted.

Combine Multiple Indicators

For highest-probability signals, require divergence on both ROC and RSI simultaneously. Dual-indicator divergence greatly reduces false signals compared to single-indicator divergence alone.

Related Indicators