Skip to content

Stochastic

Indicators

  • Price
  • High
  • Low
Stochastic

14 candles · 1 · 3

  • %K
  • %D
  • oversold
  • overbought
This is how the node looks on the board: inputs on the left, outputs on the right.

Where the price sits in its range, 0–100. Shows where the close sits within the range of the last candles: 0 means at the lowest low, 100 at the highest high. Above 80 the price closes near the high (overbought), below 20 near the low (oversold). %K is this position, %D its average over a few candles and so the calmer signal line. The “oversold” and “overbought” outputs check %K against the thresholds you drag in the chart below the price. Example: “%K below 20” together with “%K crosses above %D” fires when the price turns up again in the oversold zone.

BTC/USDT price and Stochastic 14 · 1 · 3Dots mark where %K rises from below 20 back above 20.Price BTC/USDT82,00084,00086,000Stochastic 14 · 1 · 32080Oct 7Oct 8Oct 9Oct 10
  • Price (close of each candle)
  • %K
  • %D, the signal line
  • below 20 and above 80
  • %K crosses above 20
Top: the BTC/USDT price; bottom: %K and %D of the same 1-hour candles. When the price closes near the low of the last 14 candles, %K drops below 20, near the high it rises above 80. At the dots %K leaves the oversold zone upward.

Properties of the Stochastic node: at the top the price of the last 150 candles, below it Stochastic with the zone between the thresholds and two handles at the right edge, dots at the hits, below that the Oversold below and Overbought above fields.

The properties show the price of the last 150 candles at the top and Stochastic below it, with the zone between the thresholds. Drag a threshold or type it; the number in the field follows in whole steps. Dots on the price show where “oversold” or “overbought” would be true, the top line shows how often.

More under Chart below 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: 14 · from 2 to 200, whole number

How many candles the highest high and the lowest low are taken from. 14 is the usual value. Fewer candles, such as 5, make the stochastic faster and jumpier, more candles calmer.

Default: 1 · from 1 to 50, whole number

How many candles %K is smoothed over. With 1 %K stays unsmoothed, the fast stochastic. With 3 you get the common slow stochastic, which gives fewer false signals.

Default: 3 · from 1 to 50, whole number

How many candles %K is averaged over to form the %D signal line, usually 3. When %K crosses %D, the momentum turns.

Default: 20 · from 0 to 100

When %K is below this line, the price closes near the low of its range, and the “oversold” output is true. 20 is usual.

Default: 80 · from 0 to 100

When %K is above this line, the price closes near the high of its range, and the “overbought” output is true. 80 is usual.

Notifies you when %K rises from below 20 back above 20, so the price turns up out of the oversold zone.

Example chain: Candle, Stochastic, Compare, TelegramConnections: Candle → Stochastic, Candle → Stochastic, Candle → Stochastic, Stochastic → Compare, Compare → Telegram.CandleBTC/USDT · 1hStochastic14 candles · 1 · 3CompareStoch %K 14 crosses above20Telegramlinked chat · at most every4 h

How to connect the nodes:

  1. Candle (Price) → Stochastic (Price)
  2. Candle (High) → Stochastic (High)
  3. Candle (Low) → Stochastic (Low)
  4. Stochastic (%K) → Compare (Value)
  5. Compare (true/false) → Telegram (Trigger)

On the board it reads: 14 candles · 1 · 3

Chain as JSON

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

stoch.json
{
"name": "Example: Stochastic",
"version": 1,
"nodes": [
{ "id": "c1", "type": "core.candle", "position": { "x": 40, "y": 40 }, "settings": { "pair": "BTC/USDT", "timeframe": "1h" } },
{ "id": "s1", "type": "core.stoch", "position": { "x": 260, "y": 40 }, "settings": {} },
{ "id": "k1", "type": "core.compare", "position": { "x": 480, "y": 40 }, "settings": { "operator": "crossesAbove", "value": 20 } },
{ "id": "t1", "type": "core.telegram", "position": { "x": 700, "y": 40 }, "settings": {} }
],
"edges": [
{ "from": "c1.close", "to": "s1.close" },
{ "from": "c1.high", "to": "s1.high" },
{ "from": "c1.low", "to": "s1.low" },
{ "from": "s1.k", "to": "k1.in" },
{ "from": "k1.out", "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 Price Number series required
Input High Number series required
Input Low Number series required
Output %K Number series –
Output %D Number series –
Output oversold Signal (true/false) –
Output overbought Signal (true/false) –
  • In messages the values are called “Stoch %K 14”, “Stoch %D 14”.
  • Warm-up with the default settings: 18 candles (this many extra candles are loaded by the replay before the value is reliable).
  • Search also finds it under: stochastic, oscillator, overbought, oversold, momentum, %k, %d.

%K as the SMA of 100 · (close − lowest low) / (highest high − lowest low) over the candles, %D as the SMA of %K, empty when high and low are equal; the same formula as TradingView’s built-in Stochastic with ta.stoch.

  • Type in the chain: core.stoch · Version 1.0.0 · Category key ind
  • Settings in the chain: length (Candles), smooth (%K smoothing), signal (%D signal line), oversold (Oversold below), overbought (Overbought above)
  • Pins in the chain: Input close, high, low · Output k, d, oversold, overbought
  • Reference tests in the manifest: 3 (with fixed price data: 500 candles of 1h)
  • How a node is built

Version 2026.10.21.23 · Changelog