Forex
Indicator

Indicator: What Are Donchian Channels? Trading Highest-High/Lowest-Low Breakouts

Last updated 2026-07-31

Donchian Channels are the simplest of the volatility-channel indicators on this site, and that simplicity is the entire point: instead of deriving band width from an average, a standard deviation, or an ATR multiple, a Donchian Channel is built directly from the highest high and the lowest low of the last N bars. There's no smoothing, no averaging, and no statistical formula standing between the price data and the band — the upper band literally is the most extreme price the market has printed recently, and the lower band is the opposite extreme. Developed by grain trader Richard Donchian and later made famous as the entry signal behind the 1980s Turtle Traders system, it remains one of the most direct ways to define a breakout: has price gone somewhere it hasn't been in the recent past?

How Donchian Channels Are Calculated

The calculation only needs High and Low, and it runs the same way at every bar:

  • Upper Band = the highest High of the prior N bars.
  • Lower Band = the lowest Low of the prior N bars.
  • Middle Line = (Upper Band + Lower Band) / 2, a simple midpoint rather than a moving average of price.

The default period here is 20, which mirrors the classic Turtle Trading entry rule — a 20-day breakout on daily charts, though the same logic applies on any timeframe. One detail matters for how this indicator behaves: the band at any given bar is calculated from the N bars before it, not including the bar itself. This means the band never repaints and a breakout is always measured against a range price genuinely hadn't reached yet, rather than a range that happens to include the very bar making the new high. Because there's no built-in Donchian function in either MetaTrader 4 or MetaTrader 5, donchian-channels-alert.mq4/.mq5 calculate both bands directly from the High/Low price series using this prior-N-bar window.

Entry Conditions

PriceBUYRange (band holds steady)Upper / Lower band (highest high / lowest low of prior N bars)
Entry conditions: BUY when price closes above the upper band — SELL when price closes below the lower band

The included indicator watches for a closed bar's Close finishing outside either band — above the upper band, or below the lower band. Because the bands are built from the prior N bars only, a close beyond either one means price has genuinely broken into territory it hadn't occupied in that lookback window, not merely touched its own recent extreme. A close above the upper band is read as a bullish breakout; a close below the lower band is the mirrored bearish case. The alert logic in donchian-channels-alert.mq4/.mq5 fires the moment this happens on a closed bar, the same closed-bar-confirmation approach used across every band indicator on this site to filter out signals generated by a wick that briefly pierces the band and closes back inside.

Donchian Channels vs Bollinger Bands, Keltner Channels, and Envelopes

This site now has four channel indicators, and Donchian Channels is the odd one out in a useful way — all three of the others build their bands around a moving average, while Donchian builds its bands directly from raw price extremes:

  • Bollinger Bands set width from Standard Deviation around an SMA — a statistical measure of dispersion.
  • Keltner Channels set width from ATR around an EMA — a bar-by-bar volatility measure.
  • Envelopes set width as a fixed percentage around an MA, regardless of current volatility.
  • Donchian Channels don't use a moving average or a volatility measure at all — the bands are the highest high and lowest low, full stop.

The practical difference shows up in shape: Bollinger, Keltner, and Envelope bands all curve smoothly because they track a moving average. A Donchian Channel instead moves in flat steps — the upper band sits still for as long as the current highest high holds, then jumps the instant a new one is set, giving it the staircase look in the diagram above rather than a smooth curve. That also makes a Donchian breakout unambiguous in a way the others aren't: price closing above a smoothly rising Keltner or Bollinger band is a matter of degree, but price closing above a flat Donchian band that hasn't moved in ten bars is an unmistakable statement that the market just went somewhere new.

Parameters

  • DonchianPeriod (default 20) — the lookback window both bands are built from. A shorter period (10) produces a tighter channel that price breaks more often, generating more frequent but lower-conviction signals; a longer period (55, the second entry system the original Turtle traders used) requires a genuinely larger move to trigger a signal, producing fewer but historically higher-conviction breakouts.
  • EnableAlert / EnablePush — toggle the on-screen popup alert and mobile push notification independently when a closed bar's price finishes outside either band.

How Traders Combine Donchian Channels with Other Tools

A Donchian breakout says only that price has reached a new N-bar extreme — it says nothing about whether that move has the momentum behind it to continue, which is why the original Turtle system paired the 20-bar entry with position sizing and a separate exit channel rather than trading the entry signal in isolation. ADX is a natural pairing on this site for the same reason many breakout systems use a strength filter: a Donchian breakout occurring while ADX confirms a strengthening trend carries more weight than one occurring during a flat, low-ADX reading, where the "new high" is more likely to be the edge of a range about to snap back. Checking Trend vs Range market structure before acting on a Donchian signal serves a similar purpose — a breakout that continues an already-established trend behaves differently from one that's simply testing the outer edge of a sideways range for the first time.

A Word of Caution

The strength of a Donchian Channel — that it reacts to nothing but raw price extremes — is also its main weakness: it has no way to distinguish a breakout backed by genuine momentum from a single oversized candle during a news spike that reverts just as fast as it moved. Because the band only updates when a new extreme is actually set, a market that's been quietly ranging for many bars can produce a channel that looks artificially tight, making an unremarkable move look like a dramatic breakout the moment it clears the flat band. Like any breakout-based signal, Donchian Channels confirm that a move has already happened — they cannot confirm in advance that it continues, and a Stop Loss should always assume the breakout can fail and reverse.

Download the Indicator

This custom indicator plots the Donchian Channel's upper, lower, and middle lines, and alerts when price closes outside either band. It's available for both MetaTrader 4 and MetaTrader 5 below.

How to Install — MetaTrader 4

  1. Download the donchian-channels-alert.mq4 file below.
  2. Open MetaTrader 4 → click FileOpen Data Folder.
  3. Place the file in the MQL4/Indicators folder.
  4. Restart MetaTrader 4, then drag the indicator from the Navigator window onto the chart.

How to Install — MetaTrader 5

  1. Download the donchian-channels-alert.mq5 file below.
  2. Open MetaTrader 5 → click FileOpen Data Folder.
  3. Place the file in the MQL5/Indicators folder.
  4. Restart MetaTrader 5, then drag the indicator from the Navigator window onto the chart.

Both files are source code — open and review the full code before using it, for your own safety.

Download donchian-channels-alert.mq4

For MetaTrader 4 — this is source code (.mq4), open and review it fully before using it.

Download File

Download donchian-channels-alert.mq5

For MetaTrader 5 — this is source code (.mq5), open and review it fully before using it.

Download File