# Donchian Channels

A Volatility concept (Band & channel systems) in the LuxAlgo Library, with 3 indicator implementations.

## What are Donchian Channels?

Donchian Channels plot the highest high and lowest low of the last N bars, usually with a midline halfway between them. They are named for Richard Donchian, a founding figure of systematic trend following whose four-week rule bought new four-week highs and sold new four-week lows. The channel contains no averaging and no volatility math: the upper band is simply the level a bar must exceed to print a new N-period high, which makes it the natural chart object for [breakout](https://www.luxalgo.com/library/concept/breakout/) logic, since touching the band and making a new extreme are the same event.

The bands move in a staircase: the upper band rises only when a new N-period high prints, drops only when the standing high ages out of the window, and holds flat otherwise. Price hugging one band while the bands step in the trend's direction is the visual signature of persistence, and the distance between the bands ([Donchian Width](https://www.luxalgo.com/library/concept/donchian-width/)) doubles as a simple volatility measure. The breakout reading is best known from the Turtle traders, whose published entry and exit rules were built on Donchian-style N-day extremes.

## How to calculate Donchian Channels

Construction needs nothing but highs and lows; the only decisions are the lookback and whether the current bar counts.

1. Choose the lookback N: 20 bars is the classic choice, with 55 common for slower systems and 10 for exits.
2. Set the upper band to the highest high of the last N bars and the lower band to the lowest low of the last N bars.
3. Set the midline to the average of the upper and lower bands.
4. Decide whether the current bar is included: excluding it (using the prior N bars) means a push through the band is exactly a fresh N-bar extreme, which is how breakout systems typically define the trigger.

## How it's calculated

The highest high and lowest low of the last n bars, with a midline halfway between.

```
Upper_t = max(H_i) for i = t - n + 1 to t
Lower_t = min(L_i) for i = t - n + 1 to t
Middle_t = (Upper_t + Lower_t) / 2

  Upper_t: upper channel line at bar t
  Lower_t: lower channel line at bar t
  Middle_t: channel midline at bar t
  H_i: high of bar i
  L_i: low of bar i
  n: lookback length (commonly 20)
  i: bar index within the window
  t: current bar
```

Richard Donchian's four-week rule corresponds to n = 20 trading days; the Turtle systems entered on 20-bar and 55-bar channel breakouts.

Some implementations run the window over i = t - n to t - 1, excluding the current bar, so a new extreme registers as a breakout of the prior channel.

## How traders use it

- As breakout entries: buying a push above the N-bar high and selling below the N-bar low is among the oldest systematic trend-following templates, popularized by Donchian's four-week rule and the Turtles' 20-day and 55-day systems.
- As trailing exits: trend positions trail the opposite band or the midline, exiting a long when price prints a new N-bar low on a shorter window than the entry (the Turtles paired 20-day entries with 10-day exits).
- As a trend read: stair-stepping bands with price pinned to one side indicate persistence, the basis of [Donchian trend rules](https://www.luxalgo.com/library/concept/donchian-trend-rules/); flat bands on both sides frame a [trading range](https://www.luxalgo.com/library/concept/trading-range/) with its extremes marked.
- As objective range markers: the bands are exact N-period extremes, so they anchor level-based logic (stops beyond the opposite band, range measurement, screening for new highs) without any smoothing ambiguity.

## Donchian Channels vs related concepts

- **Bollinger Bands** (https://www.luxalgo.com/library/concept/bollinger-bands/): Centered on a moving average and scaled by standard deviation, they describe typical dispersion around the mean. Donchian bands mark absolute extremes, which is why price can ride a Donchian band exactly while only approaching a Bollinger band.
- **Keltner Channels** (https://www.luxalgo.com/library/concept/keltner-channels/): An ATR offset around an EMA: a smoothed container for normal range. Donchian Channels carry no smoothing at all, so they respond instantly to new extremes and stay perfectly flat otherwise.
- **Prior Period Levels** (https://www.luxalgo.com/library/concept/prior-period-levels/): Prior day, week, or month highs and lows are fixed once the period closes. A Donchian band is a rolling extreme that updates bar by bar as its window slides forward.

## FAQ

### What is the best lookback period for Donchian Channels?

There is no single best. Twenty bars is the traditional default (roughly a month of daily bars), 55 suits slower trend systems, and shorter windows like 10 are common for exits. Longer lookbacks trade less often and give back more at exits; shorter ones react faster but whipsaw more. Match the window to your holding horizon and test it.

### Are Donchian Channels the same thing as the Turtle system?

No. The Turtles used Donchian-style channel breakouts (20-day and 55-day entries, 10-day and 20-day exits) as their levels, but the system's behavior depended just as much on volatility-based position sizing, pyramiding, and strict risk limits. The channel supplies the entry and exit levels; it is not the whole methodology.

### Why do Donchian Channels look like stairs instead of curves?

Because there is no averaging. Each band equals a rolling extreme, and an extreme only changes when a new high or low prints or when the old extreme falls out of the N-bar window. Between those events the band is exactly flat, which produces the characteristic step shape and makes band touches unambiguous events.

## Implementations in the Library

- Donchian MA Bands (LuxAlgo): https://www.luxalgo.com/library/indicator/donchian-ma-bands/
- Donchian Zig-Zag (LuxAlgo): https://www.luxalgo.com/library/indicator/donchian-zig-zag/
- Donchian Channels (LuxAlgo, the standard build of the classic formula): https://www.luxalgo.com/library/indicator/donchian-channels/

## Related concepts

- Envelope: https://www.luxalgo.com/library/concept/envelope/
- Bollinger Bands: https://www.luxalgo.com/library/concept/bollinger-bands/
- %B: https://www.luxalgo.com/library/concept/percent-b/
- BandWidth: https://www.luxalgo.com/library/concept/bandwidth/
- Bollinger Squeeze: https://www.luxalgo.com/library/concept/bollinger-squeeze/
- Band Walk: https://www.luxalgo.com/library/concept/band-walk/
- Bollinger Band Tag Reversion: https://www.luxalgo.com/library/concept/bollinger-band-tag-reversion/
- Double Bollinger Zones: https://www.luxalgo.com/library/concept/double-bollinger-zones/
- Fibonacci Bollinger Bands: https://www.luxalgo.com/library/concept/fibonacci-bollinger-bands/
- Keltner Channels: https://www.luxalgo.com/library/concept/keltner-channels/

---

Source: https://www.luxalgo.com/library/concept/donchian-channels/ (LuxAlgo Library, the encyclopedia of trading & technical analysis). Free to use with attribution: https://www.luxalgo.com/library/license/