Skip to main content

Donchian Channels

TL;DR

Donchian Channels plot three lines: the highest high over the last N bars, the lowest low over the last N bars, and the middle point between them. They answer one question: "has price broken out of its recent range?" Made famous by the Turtle Traders of the 1980s, who used 20-bar and 55-bar Donchian breakouts to build one of the most legendary trend-following systems ever documented.

The formulas

Upper = highest high of last N bars
Lower = lowest low of last N bars
Middle = (Upper + Lower) / 2

That's the entire indicator. No averages, no standard deviations, no smoothing. Just: what's the highest high and lowest low recently?

Classic Turtle settings: 20 and 55. The 20-bar system for shorter swings, the 55-bar for longer-term trends.

How to use Donchian Channels

Breakout entries. Long when price closes above the 20-bar high. Short when price closes below the 20-bar low. This is the original Turtle signal. Brutally simple.

Trend filter. When price is riding the upper band, the trend is strong bullish. Riding the lower band = strong bearish. Middle-band traversal = undecided.

Trailing stop. For a long position, trail a stop to the 10-bar low. As price makes new highs, the 10-bar low rises, tightening the stop. This is the Turtle exit rule — you stay in the trade as long as price keeps extending.

The Turtle Trading system, abbreviated

The Turtles ran two parallel systems:

System 1 (shorter): Enter on a 20-bar breakout. Exit on a 10-bar counter-breakout.

System 2 (longer): Enter on a 55-bar breakout. Exit on a 20-bar counter-breakout.

Position sizing was volatility-normalized using N (Wilder's ATR). Each trade risked a fixed percentage of account equity — what is now standard position-sizing practice, but was novel at the time.

The Turtle system returned ~80% annualized over a 4-year period in the 1980s. Modern markets have made pure Donchian breakouts less effective (more participants fading them), but the core idea still works as a building block.

Donchian Channels in Pine Script (v6)

//@version=6
indicator("Donchian Channels + Breakout Alerts", overlay=true)

length = input.int(20, "Channel Length")

upper = ta.highest(high, length)
lower = ta.lowest(low, length)
middle = (upper + lower) / 2

plot(upper, color=color.blue, linewidth=2, title="Upper")
plot(lower, color=color.blue, linewidth=2, title="Lower")
plot(middle, color=color.orange, title="Middle")

// Breakout alerts using prior bar's channel to avoid lookahead
longBreak = close > upper[1]
shortBreak = close < lower[1]

if longBreak and not (close[1] > upper[2])
alert("Donchian bullish breakout (" + str.tostring(length) + "-bar) on " + syminfo.ticker, alert.freq_once_per_bar_close)
if shortBreak and not (close[1] < lower[2])
alert("Donchian bearish breakout (" + str.tostring(length) + "-bar) on " + syminfo.ticker, alert.freq_once_per_bar_close)

Note the upper[1] and lower[1] — we use the prior bar's channel to avoid lookahead bias. You can't "break above" a line that already includes today's bar.

Common mistakes

  • Running pure breakouts without filters. Modern markets whip more than 1980s futures did. Add a trend filter (daily 200 EMA) or ADX > 20 requirement.
  • Using a fixed length without thought. 20 on ES daily captures swing trends. 20 on ES 1-minute captures noise. Tune to your trading timeframe.
  • Ignoring the exit rule. Turtle-style, you exit on the opposite-side Donchian break (10-bar for System 1). Cutting winners early kills the strategy's edge.

Frequently Asked Questions

What period should I use for Donchian Channels?

The classic Turtle settings are 20-bar (shorter-term) and 55-bar (longer-term). For day trading on 5-minute charts, try 20 bars for swing breakouts and 50 for session-range extremes. For daily swing trading, 20 and 55 remain sensible defaults.

Do Donchian breakouts still work?

Yes, but less cleanly than in the 1980s. Markets are more efficient; pure breakouts get faded more often. Modern Donchian usage includes filters (ADX, higher-timeframe trend), uses it as one of several signals rather than alone, or pairs it with volume confirmation.

Donchian vs Keltner vs Bollinger — what's the difference?

Donchian = literal highs and lows of last N bars. Keltner = EMA ± ATR multiple. Bollinger = SMA ± standard deviation multiple. Donchian is the sharpest breakout signal; Keltner is the smoothest trend envelope; Bollinger is best for mean-reversion and squeeze detection.