Donchian Channel
Calculate upper, middle, and lower channel bands based on the highest high and lowest low over a configurable lookback period. The Donchian Channel rule identifies the price range boundaries established over recent bars, making it ideal for breakout strategies, trend identification, and setting dynamic support and resistance levels based on actual price extremes.
How It Works
The Donchian Channel rule computes three band values by examining the high and low price sources over a specified lookback period:
- Upper Band — The highest value from the High Source over the lookback period. This represents the ceiling of the recent price range and acts as a resistance level. A price break above this level signals a potential upward breakout.
- Lower Band — The lowest value from the Low Source over the lookback period. This represents the floor of the recent price range and acts as a support level. A price break below this level signals a potential downward breakout.
- Middle Band — The midpoint between the upper and lower bands, calculated as (Upper + Lower) / 2. This provides a dynamic equilibrium level that can serve as a trend direction indicator or a mean-reversion target.
Unlike Bollinger Bands which use standard deviation to define the channel width, the Donchian Channel uses actual price extremes. This means the channel boundaries represent real support and resistance levels that the market has tested, making breakout signals based on these levels particularly meaningful.
The High Source and Low Source are configured separately, which allows you to connect different data series for each. Typically these are connected to the High and Low outputs of a Price Data rule, but you can use any numeric sources to create custom channel calculations.
Inputs
| Input | Description | Required | Default |
|---|---|---|---|
| High Source | The data series used to determine the upper band. The rule finds the highest value in this series over the lookback period. Typically connected to the High output of a Price Data rule. | Yes | — |
| Low Source | The data series used to determine the lower band. The rule finds the lowest value in this series over the lookback period. Typically connected to the Low output of a Price Data rule. | Yes | — |
| Lookback | The number of bars to examine when finding the highest high and lowest low. A longer lookback captures a wider price range and produces fewer breakout signals; a shorter lookback captures a narrower range and produces more frequent signals. | No | 20 |
| Offset | The number of bars to look back into the historical series before returning the values. An offset of 0 returns the current values, 1 returns the previous bar's values, and so on. | No | 0 |
Outputs
| Output | Description | List |
|---|---|---|
| Lower Band Value | The lowest low over the lookback period, representing the floor of the recent price range. Use this as a dynamic support level or a downside breakout trigger. | No |
| Middle Band Value | The midpoint between the upper and lower bands. Use this as a trend direction indicator (price above the middle suggests bullish, below suggests bearish) or as a mean-reversion target. | No |
| Upper Band Value | The highest high over the lookback period, representing the ceiling of the recent price range. Use this as a dynamic resistance level or an upside breakout trigger. | No |
Tips
The Donchian Channel is the foundation of the classic Turtle Trading strategy. Connect the Upper Band output to a Compare Switch rule to detect when the current price breaks above the 20-period high for an entry signal, and use a separate Donchian Channel with a 10-period lookback for the exit signal when price breaks below the 10-period low. For trend filtering, compare the current price to the Middle Band output: trade only in the long direction when price is above the midline, and only in the short direction when below. You can also use Donchian Channels on multiple timeframes by connecting different Price Data rules, entering on a shorter-period breakout only when the longer-period channel confirms the trend direction.
Was this helpful? Let us know