Skip to content

Divergence

IndicatorsFrom Pro

  • Oscillator
  • High
  • Low
Divergence

RSI 14 · 5 · 5

  • bullish
  • bearish
This is how the node looks on the board: inputs on the left, outputs on the right.

Price and oscillator move apart. Compares two consecutive lows (or highs) of an oscillator such as RSI or MACD with the price on the same candles. Bullish divergence: the price makes a lower low, the oscillator a higher one, so the sell-off is losing momentum. Bearish divergence: the price makes a higher high, the oscillator a lower one. A low only counts once the chosen candles after it have confirmed it; the node reports that many candles later, never in hindsight. Example: RSI 14 with Divergence on 4-hour candles reports “bullish” when BTC falls below its last low but the RSI stays higher.

BTC/USDT with regular divergences on the RSI 14Lines between two highs or lows in the price and in the RSI that run in different directions; a mark where the divergence is reported.Price BTC/USDT80,00082,00084,00086,000DivDivRSI 143070Oct 2Oct 3Oct 4Oct 5Oct 6Oct 7Oct 8Oct 9
  • Bullish divergence
  • Bearish divergence
  • reported, low or high confirmed
  • RSI 14
BTC/USDT candles with the RSI 14 below. Red: the price makes a higher high, the RSI a lower one, the bearish divergence. Green: the price makes a lower low, the RSI a higher one, the bullish one. The “Div” mark sits on the candle where the second high or low of the RSI is confirmed, 5 candles later; that is where the node reports, never in hindsight.

Properties of the Divergence node: the chart with BTC/USDT candles (sample prices) and lines between the two lows or highs of the divergences above the candles and in the RSI below, “Div” marks on the candles where they are reported, below it the first fields.

In the properties, a chart shows the last 150 candles and below them the oscillator at the input, such as the RSI. Each divergence appears as a line between the two lows or highs, in the price and in the oscillator, green for bullish, red for bearish; the “Div” mark sits on the candle where it is reported. The chart follows every setting right away, such as “Candles after” or “Distance at most”.

More under Chart above the price.

The settings appear on the right under “Properties” once you click the node on the board. Below each field you find the same explanation as here.

Default: Regular

Which divergence the node reports. For both types use two nodes.

  • Regular (default): Bullish: the price makes a lower low, the oscillator a higher one. The sell-off is losing momentum, often before a turn up. Bearish the other way round at highs.
  • Hidden: Bullish: the price makes a higher low, the oscillator a lower one. The pullback in an uptrend was deep in the oscillator but shallow in the price; many read this as the trend continuing. Bearish the other way round at highs.

Default: 5 · from 1 to 50, whole number

How many candles before a low of the oscillator must all be higher, before a high lower. More candles: only clearer lows and highs.

Default: 5 · from 1 to 50, whole number

How many candles after a low of the oscillator must not fall below it before it is confirmed. The divergence reports that many candles later; fewer candles report sooner, but also for smaller lows.

Default: 5 · from 1 to 200, whole number

At least this many candles must lie between the two lows or highs.

Default: 60 · from 2 to 500, whole number

At most this many candles may lie between the two lows or highs. The node no longer compares older lows.

Bullish RSI divergence: the price falls below its last low while the RSI stays higher. Telegram notifies you 5 candles after the second low, once it is confirmed.

Example chain: Candle, RSI, Divergence, TelegramConnections: Candle → RSI, RSI → Divergence, Candle → Divergence, Candle → Divergence, Divergence → Telegram.CandleBTC/USDT · 1hRSI14 candlesDivergenceRSI 14 · 5 · 5Telegramlinked chat · at most every4 h

How to connect the nodes:

  1. Candle (Price) → RSI (Value)
  2. RSI (RSI) → Divergence (Oscillator)
  3. Candle (High) → Divergence (High)
  4. Candle (Low) → Divergence (Low)
  5. Divergence (bullish) → Telegram (Trigger)

On the board it reads: RSI 14 · 5 · 5

Chain as JSON

To try it, copy it and paste it in the editor under “Import”. Importing creates a new chain.

divergence.json
{
"name": "Example: Divergence",
"version": 1,
"nodes": [
{ "id": "c1", "type": "core.candle", "position": { "x": 40, "y": 40 }, "settings": { "pair": "BTC/USDT", "timeframe": "1h" } },
{ "id": "r1", "type": "core.rsi", "position": { "x": 260, "y": 40 }, "settings": { "length": 14 } },
{ "id": "d1", "type": "core.divergence", "position": { "x": 480, "y": 40 }, "settings": {} },
{ "id": "t1", "type": "core.telegram", "position": { "x": 700, "y": 40 }, "settings": {} }
],
"edges": [
{ "from": "c1.close", "to": "r1.in" },
{ "from": "r1.out", "to": "d1.osc" },
{ "from": "c1.high", "to": "d1.high" },
{ "from": "c1.low", "to": "d1.low" },
{ "from": "d1.bull", "to": "t1.in" }
]
}

Only matching types connect: number series to number series (round pin), signal to signal (square), message to message (diamond).

Direction Pin Type Note
Input Oscillator Number series required
Input High Number series required
Input Low Number series required
Output bullish Signal (true/false) –
Output bearish Signal (true/false) –
  • Warm-up with the default settings: 71 candles (this many extra candles are loaded by the replay before the value is reliable).
  • Search also finds it under: divergence, rsi divergence, macd divergence, bullish, bearish, hidden, momentum, reversal.

Pivot lows and highs of the oscillator as in the Swing points node (lower or higher than the candles before, at least as low or high as those after). Two consecutive pivots that lie the chosen number of candles apart are compared with the low or high of the candle at each pivot. Regular bullish: lower low, higher oscillator; hidden bullish: higher low, lower oscillator; mirrored at highs. Reported on the candle that confirms the second pivot. Built like the divergence script in TradingView, with the distance between the pivots instead of the candles in between.

  • Type in the chain: core.divergence · Version 1.0.0 · Category key ind
  • Settings in the chain: kind (Type), left (Candles before), right (Candles after), minBars (Distance at least), maxBars (Distance at most)
  • Pins in the chain: Input osc, high, low · Output bull, bear
  • Reference tests in the manifest: 2 (with fixed price data: 500 candles of 1h)
  • How a node is built

Version 2026.10.24.21 · Changelog