Donchian Channels

The highest high and lowest low over the lookback period, plotted as a channel. The simplest envelope indicator — and the foundation of classic breakout systems.

IndicatorBy AlgoLiftUpdated 5 min read
On this page 13What it measuresFormulaInputs in AlgoLiftRecommended periodsOutputs in AlgoLiftHow to read itBest in / worst inThree setups1. The classic 20-day breakout (Turtle Trader entry)2. Channel width compression entry3. Multi-Donchian systemAdvanced patterns in AlgoLiftCommon mistakes

The simplest envelope indicator possible: the upper band is the highest high over the lookback period, the lower band is the lowest low, the middle band is their midpoint. No smoothing, no math beyond max/min. The foundation of classic trend-following systems like the Turtle Traders' 20-day breakout strategy.

What it measures

  • Recent extremes. Where the highest high and lowest low have been over the lookback. Pure structural levels.
  • Breakout reference. Price closing above the upper band means it's making a new period-high — the textbook breakout signal.
  • Range bounds. The channel itself defines the recent trading range; the middle line is its midpoint.

Formula

Inputs in AlgoLift

SettingDefaultRangeNotes
Period202–500Lookback for the highest high and lowest low.
  • 10 (fast): Short-term breakout — frequent signals.
  • 20 (default): Donchian's original — and the Turtle Traders' entry. Works on daily charts.
  • 55: The Turtle Traders' exit period (and slower entry variant).
  • 100+ (slow): Long-horizon breakout strategies on weekly bars.

Outputs in AlgoLift

HandleTypePlottedNotes
Upper BandNumericAlwaysThe highest high over the lookback.
Lower BandNumericAlwaysThe lowest low over the lookback.
Middle BandNumericAlwaysMidpoint of upper and lower.
Channel WidthNumericOn selectUpper − Lower. High width = high volatility; low width = consolidation.
%BNumericOn selectPosition within the channel (0 = lower, 1 = upper, 0.5 = middle).
SlopeNumericOn selectRate of change of the middle band.

How to read it

  • Price closes above Upper Band: New high for the lookback — classic breakout signal.
  • Price closes below Lower Band: New low for the lookback — breakdown signal.
  • Price between bands: Inside the recent range — no breakout.
  • Channel Width contracting: Recent volatility decreasing. Compressed range, possible setup for a breakout when it resolves.
  • Channel Width expanding: Volatility increasing — current trend extending.
  • %B near 0: Price near recent lows.
  • %B near 1: Price near recent highs.

The Upper and Lower bands are stair-step functions — they hold a value until a new extreme is reached, then jump. This is different from smoothed indicators (Bollinger, Keltner) where the bands change every bar.

Key Takeaway

Donchian's value is its simplicity. The upper and lower bands aren't statistical abstractions — they're literally the highest high and lowest low. Breakouts above or below mean exactly what they look like. No interpretation needed.

Best in / worst in

Best in trending markets, on liquid instruments with clear breakout/breakdown dynamics, and as the foundation for trend-following systems. The simplicity is a feature, not a limitation.

Worst in range-bound markets (breakouts fail constantly), and on very-low-volume instruments where a single thin-liquidity bar can set a "new high" that doesn't represent real demand.

Three setups

1. The classic 20-day breakout (Turtle Trader entry)

The most famous Donchian setup.

  • Long: Price closes above the previous bar's Upper Band (not the current bar's, which would be circular). I.e., Close[t] > UpperBand[t−1].
  • Short: Price closes below the previous bar's Lower Band.

Use a different exit period — the Turtles used 10 for exits (close out longs when price closes below the 10-bar low). Combine with position sizing based on ATR for the complete original system.

2. Channel width compression entry

Trade breakouts only after volatility has compressed.

  • Setup condition: Channel Width has been below its 50-bar average for at least 10 consecutive bars (consolidation).
  • Long: Setup condition AND price closes above Upper Band.
  • Short: Setup condition AND price closes below Lower Band.

The compression filter dramatically reduces false breakouts from random spikes.

3. Multi-Donchian system

Use two Donchian channels at different periods.

  • Slow Donchian(55): Defines regime — current Upper > previous Upper(55) for 55 bars = bullish regime.
  • Fast Donchian(20): Provides entry trigger.
  • Long: In bullish regime AND price > Donchian(20) Upper. Exit when price < Donchian(20) Lower.
  • Short: Symmetric.

The slow channel filters out the worst false signals from the fast channel.

Advanced patterns in AlgoLift

Donchian as an ATR-free trailing stop. In a long trade, use the current Lower Band as the trailing stop (it only moves up, never down, as new lows fall out of the lookback). Wire via Set Stop Loss. Functions like Parabolic SAR but simpler — no acceleration parameter to tune.

Channel width for position sizing. Scale position size inversely to Channel Width — narrow channel (consolidation, low risk per bar) = larger size, wide channel (volatility expansion, high risk per bar) = smaller size. The math automatically right-sizes for current conditions.

Donchian breakout + Re-arm when. Wire "price back inside the channel" into Re-arm when on the breakout's Entry node (its Cooldown set to wait until a condition), so after a trade closes the strategy can't re-enter until price has pulled back inside the channel. Eliminates machine-gun re-entries on the same breakout level.

Donchian for instrument screening. Compute Channel Width on multiple instruments via Data Source nodes. Trade only the 2-3 instruments with the lowest Width (most compressed) — these are the highest-probability breakout candidates.

Common mistakes

  • Using the current bar's band in the comparison. Close > UpperBand[current] is circular — the band is defined to include the current bar. Always use BarsAgo Modifier to compare against UpperBand[t−1].
  • Trading every breakout in chop. Donchian breakouts in range-bound markets fail constantly. Pair with a regime filter (ADX, KAMA Efficiency Ratio) or only run during known-trending periods.
  • Skipping the exit period. The Turtle system uses different periods for entry (20) and exit (10). Using the same period for both creates symmetric whipsaw behavior. Different periods preserve the trend-following character.
  • Treating Donchian as a mean-reversion tool. Donchian's structure (no smoothing, hard extremes) is designed for breakouts. Mean reversion uses Bollinger or Keltner instead.
Common Misconception
Myth
Donchian Channels are too simple to be useful for modern markets.
Reality
The Turtle Traders of the 1980s built their breakout rules on this indicator, with disciplined position sizing. Donchian's simplicity *is* its advantage: there's nothing to overfit, nothing to second-guess. The strategies that fail with Donchian fail because of sizing, regime selection or psychology, not because the indicator's math is too simple.