Skip to content

Free MT5 indicator

Donchian Channel Breakout

Donchian Channel for MT5 with highest-high and lowest-low bands, a midline and arrows when a closed bar breaks the prior channel.

Breakoutv1.0MetaTrader 5 (MQL5) Compiles with 0 errors Non-repainting signals Alerts

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

InputDefaultWhat it changes
Channel period (bars)20Longer periods give fewer, larger breakouts
Breakout on wickfalseWick mode reacts sooner but triggers more often
Popup alertfalseAlerts once per bar on a new arrow
Push notificationfalseSends 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.

Key inputs

Key inputs of Donchian Channel Breakout
InputDefaultDescription
Channel period (bars)20Number of bars used for the highest high and lowest low.
Breakout on wick (high/low) instead of closefalseUse the bar's high or low instead of its close to detect breakouts.
Popup alert on a new breakoutfalseShows an MT5 alert once per bar when a new arrow appears.
Push notification on a new breakoutfalseSends a notification to the MT5 mobile app.

Educational tools, not advice. Indicators and Expert Advisors describe price; they do not predict it, and past behaviour does not guarantee future results. Test everything on a demo account first and never risk money you cannot afford to lose. See our disclaimer.

Keep exploring

Related mt5 indicators