โ๏ธ Donchian Channels
Donchian Channels draw the simplest possible volatility envelope: the highest high and lowest low over the last \(N\) periods, with no averaging or weighting at all โ pure extrema.
๐ก Financial Meaning
This is the indicator behind the legendary "Turtle Trading" breakout system: buy when price closes above the upper channel (a new \(N\)-period high), sell/short when it closes below the lower channel. The width of the channel also doubles as a volatility gauge โ a wide channel means the market has ranged broadly over the window, a narrow one means it has been unusually contained.
๐ข Mathematical Formulas
-
Upper Channel โ the rolling maximum of the high over the window:
\[ Upper_t = \max_{0 \le i < N} H_{t-i} \] -
Lower Channel โ the rolling minimum of the low over the window:
\[ Lower_t = \min_{0 \le i < N} L_{t-i} \] -
Middle Line โ the simple midpoint of the two:
\[ Middle_t = \frac{Upper_t + Lower_t}{2} \]
โ๏ธ Parameters
| Parameter | Key | Default | Description |
|---|---|---|---|
| Period (\(N\)) | period |
20 | Lookback window for the rolling max/min, in sessions. |
Drawn across closed days
The channels have a value on sessions only, while the chart's date axis runs through every calendar day. Over a weekend or a holiday, the shaded channel is drawn in a straight line from the last session before to the first one after, as the middle line is, so it does not break: the bridged stretch only shapes the fill and carries no value of its own.
๐๏ธ Signal Processing Equivalent โ Sliding-Window Max/Min (Morphological Filter)
Donchian's channel construction is a max filter and a min filter applied over a sliding window โ exactly the dilation and erosion operators from mathematical morphology, applied here in one dimension. Unlike every averaging filter in this catalogue, a max/min filter is not linear: it cannot be described by a convolution or a transfer function \(H(z)\), and it responds instantaneously to a new extreme rather than blending it in gradually.
flowchart LR
H["๐ High"] --> UP["๐ผ Rolling max over N bars"]
L["๐ Low"] --> DN["๐ฝ Rolling min over N bars"]
UP --> UPPER["โ๏ธ Upper channel"]
DN --> LOWER["โ๏ธ Lower channel"]
UPPER --> MID["โ Middle = (Upper+Lower)/2"]
LOWER --> MID
Step-function behaviour
Because the channel only updates when a new extreme appears, both bands move in discrete steps rather than smoothly โ a sharp contrast with Bollinger Bands, whose \(\pm k\sigma\) envelope reacts gradually to every new observation.