What it does
The Donchian Channel is one of the oldest breakout tools: the upper line is the highest high of the last N bars, the lower line is the lowest low, and the midline sits halfway between. When price closes above the previous channel high it has made a new N-bar high on a closing basis, and this indicator marks that bar with an arrow. The same applies to new lows.
How it works
- Upper channel = highest high of the last N bars, including the current bar.
- Lower channel = lowest low of the last N bars, including the current bar.
- Midline = (upper + lower) / 2.
- Because the current bar is part of its own channel, breakouts are measured against the previous bar's channel. An up arrow prints when a closed bar's close is above the previous bar's upper line and the bar before it was not already above its own prior channel. Down arrows use the lower line.
- With the wick option on, the high (for up) and low (for down) replace the close.
Arrows are calculated on closed bars only.
How to use it
Donchian breakouts are a classic trend-following entry: the logic is that a market making a new 20-bar or 55-bar extreme may continue in that direction. Many trend systems pair a longer channel for entries with a shorter one for exits, for example buying a 20-bar breakout and exiting on a close below a 10-bar low. You can load two copies of the indicator with different periods for that.
The midline is a useful reference for trend bias: price holding above it suggests buyers are in control of the recent range. Daily and four-hour charts suit this approach best. Always define a stop-loss before acting on a breakout, since many breakouts fail. Recent support and resistance zones around the channel lines can help judge whether a breakout has room to run.
Settings
| Input | Default | What it changes |
|---|---|---|
| Channel period (bars) | 20 | Longer periods give fewer, larger breakouts |
| Breakout on wick | false | Wick mode reacts sooner but triggers more often |
| Popup alert | false | Alerts once per bar on a new arrow |
| Push notification | false | Sends the alert to the MT5 mobile app |
Limitations
- Breakout systems are typically right a minority of the time and rely on occasional large moves; long losing streaks are normal.
- In sideways markets price repeatedly pokes through the channel and reverses.
- The channel is flat until a new extreme appears, so it says nothing about how strong a trend is.
- Wick breakouts are sensitive to spread spikes and thin liquidity.

