TREND, MOVING AVERAGES & STRUCTURE

Donchian channel

A channel drawn straight through the recent highs and lows.

spec id: donchianoutputs: upper · mid · lowerlength (default 20)

What does Donchian channel measure?

A channel drawn straight through the recent highs and lows. Price breaking out of it is the oldest trend-following signal there is.

How is Donchian channel calculated?

The upper line is the highest high of the last 20 candles, the lower line the lowest low, and `mid` is the two averaged.

Written by reading the engine’s real computation, not a textbook — where the two differ, the page describes what actually runs.

How do I use Donchian channel in a bot?

In the builder, add an indicator of type donchian (parameters: length, default 20). Its output series — upper, mid, lower — become operands you can compare in any entry or exit rule. The engine grades the whole rule honestly: real fills, no look-ahead, half the history held back.

See it inside a famous strategy

Related indicators

Or browse all 158 indicators in the full library.

Build a bot that trades on Donchian channel — the first backtest is free.

Run a free backtest