Skip to content

Donchian Channel

Indicators

  • High
  • Low
Donchian Channel

20 candles

  • Upper
  • Middle
  • Lower
This is how the node looks on the board: inputs on the left, outputs on the right.

Channel of the highest high and lowest low. Draws a channel around the candles: the highest high of the last candles at the top, the lowest low at the bottom and the value in between in the middle. When the price closes above the channel, it has made a new high for that period, a classic breakout signal. Example: “Price crosses above upper Donchian band” with 20 candles reports a breakout above the high of the last 20 candles.

BTC/USDT price with Donchian Channel 20The channel spans the high and low of the 20 candles before; dots mark breakouts above the upper band.Price BTC/USDT84,00086,000Oct 4Oct 5Oct 6Oct 7
  • Price (close of each candle)
  • channel from the high and low of the 20 candles before
  • middle
  • upside breakout
BTC/USDT with the Donchian Channel of the 20 candles before, without the current candle. It holds until a new high or low comes in or an old one drops out of the period. At the dots the price closes above the upper band, a new 20-candle high.

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: 20 · from 2 to 500, whole number

How many candles the high and low come from. 20 is usual, 55 for longer breakouts.

Default: exclude · under “More”

Whether the candle that just closed counts. For breakout alerts leave it out, otherwise the price can never be above the channel.

  • exclude (default): High and low of the candles before. Right for breakouts.
  • include: High and low including the current candle, the way most charts draw the channel.

A breakout: the price closes above the highest high of the 20 candles before.

Example chain: Candle, Donchian Channel, Compare A/B, TelegramConnections: Candle → Donchian Channel, Candle → Donchian Channel, Candle → Compare A/B, Donchian Channel → Compare A/B, Compare A/B → Telegram.CandleBTC/USDT · 1hDonchian Channel20 candlesCompare A/BPrice crosses above upperDonchian bandTelegramlinked chat · at most every4 h

How to connect the nodes:

  1. Candle (High) → Donchian Channel (High)
  2. Candle (Low) → Donchian Channel (Low)
  3. Candle (Price) → Compare A/B (A)
  4. Donchian Channel (Upper) → Compare A/B (B)
  5. Compare A/B (true/false) → Telegram (Trigger)

On the board it reads: 20 candles

Chain as JSON

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

donchian.json
{
"name": "Example: Donchian Channel",
"version": 1,
"nodes": [
{ "id": "c1", "type": "core.candle", "position": { "x": 40, "y": 40 }, "settings": { "pair": "BTC/USDT", "timeframe": "1h" } },
{ "id": "d1", "type": "core.donchian", "position": { "x": 260, "y": 40 }, "settings": {} },
{ "id": "k1", "type": "core.compare-ab", "position": { "x": 480, "y": 40 }, "settings": { "operator": "crossesAbove" } },
{ "id": "t1", "type": "core.telegram", "position": { "x": 700, "y": 40 }, "settings": {} }
],
"edges": [
{ "from": "c1.high", "to": "d1.high" },
{ "from": "c1.low", "to": "d1.low" },
{ "from": "c1.close", "to": "k1.a" },
{ "from": "d1.upper", "to": "k1.b" },
{ "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 High Number series required
Input Low Number series required
Output Upper Number series appears in messages as a price, e.g. “$81,616”
Output Middle Number series appears in messages as a price, e.g. “$81,616”
Output Lower Number series appears in messages as a price, e.g. “$81,616”
  • In messages the values are called “upper Donchian band”, “Donchian middle”, “lower Donchian band”.
  • Warm-up with the default settings: 21 candles (this many extra candles are loaded by the replay before the value is reliable).
  • Search also finds it under: donchian, channel, breakout, turtle, high, low, volatility.

Top the highest high, bottom the lowest low of the candles, middle (top + bottom) / 2; shifted by one candle when the current one is excluded. With “include” the same values as TradingView’s built-in Donchian Channels indicator.

  • Type in the chain: core.donchian · Version 1.0.0 · Category key ind
  • Settings in the chain: length (Candles), current (Current candle)
  • Pins in the chain: Input high, low · Output upper, middle, lower
  • Reference tests in the manifest: 1 (with fixed price data: 500 candles of 1h)
  • How a node is built

Version 2026.10.21.23 · Changelog