The Donchian Channel, developed by Richard Donchian, is one of the simplest trend-following tools. Its upper band is the highest high and its lower band is the lowest low of the last N bars; the middle line is their average. A price that moves beyond the channel has made a new N-bar high or low, which is the basis of the classic "channel breakout" approach (used, for example, in the Turtle trading rules).
The channel itself contains the current bar, so the bar can never leave it. Therefore the indicator compares every bar with the channel of the previous bar: a bar that closes above the previous upper band (or below the previous lower band) is a breakout. The arrow is drawn only on the first bar of a breakout, not on every following bar outside the channel, and an alert is sent once per bar.

Fig. 1. Donchian Channel (20) on an H1 chart with the middle line and breakout arrows: bullish breakouts below the bars, bearish breakouts above the bars; black & white image per Code Base image guidelines (colors are configurable).
| Input | Default | Purpose |
|---|---|---|
| InpPeriod | 20 | Number of bars used for the highest high and the lowest low (2 or more). |
| InpShowMiddle | true | Shows the middle line of the channel. |
| InpBreakoutBy | DON_BREAKOUT_CLOSE | Breakout condition: the close beyond the previous channel (DON_BREAKOUT_CLOSE) or the high above / the low below it (DON_BREAKOUT_EXTREME). |
| InpShowArrows | true | Draws the breakout arrows on the chart (alerts work regardless of this setting). |
| InpAlertPopup | true | Shows an alert window. |
| InpAlertPush | false | Sends a push notification to the mobile terminal. |
| InpAlertEmail | false | Sends an e-mail. |
| InpAlertOnBarClose | true | true: the alert refers to the last closed bar; false: the alert is sent as soon as the forming bar fulfills the condition. |
| InpShowInfoLabel | true | Shows the label with the channel values, width and status. |
| InpLabelColor | clrSilver | Color of the info label. |
The colors and line styles of the bands and the arrows can be changed on the "Colors" tab of the indicator properties.
Squeeze Momentum: Bollinger Bands Inside Keltner Channel
Squeeze Momentum indicator: detects periods of volatility compression, when the Bollinger Bands move inside the Keltner Channel, and shows the direction and strength of the momentum that builds up during and after the squeeze.
Truncation Audit: Detecting Look-Ahead and Repainting in MQL5 Indicators.
Part 3 of the indicator regression-testing series. Compares the value an indicator had when each bar closed with the value recomputed on the later history, flags every bar that changed (look-ahead or repainting), and measures how many future bars each value needed before it settled.
Volatility Regime Indicator (Low, Normal, High) in a Subwindow
Classifies the current market volatility as Low, Normal or High by ranking the ATR against its own recent history. The percent rank is shown as a color-coded histogram in a subwindow, with optional alerts when the regime changes.
Chart Indicators to CSV
A script for MetaTrader 5 that exports the raw values of all buffers of every indicator on a chart to one CSV file, without changing any code.