Skip to content

Donchian Channels

What it shows: the highest high and the lowest low of the last few candles, with a middle line halfway between.

How people use it: a breakout above the previous highest high is a classic trend-following buy (the "Turtle" method); a break below the lowest low a sell.

Pairs well with: ATR or ADX to check the breakout has strength, and a volume indicator such as Volume.

Settings

Setting Default What it does
Lower length 20 Candles for the lower line. Longer means a break below it is rarer.
Upper length 20 Candles for the upper line. Longer means a breakout above it is rarer (fewer, bigger signals).

You set the defaults on the Indicators page. A condition can use its own settings, which override the defaults for that condition only.

Ready-made conditions

For Condition Fires when
Buy Price crosses lower Donchian band (prior bar) the one candle price moves from above the Lower line of the previous candle to below it
Buy or sell Price touches Donchian middle line price reaches the Middle line during the candle, from either side
Sell Price crosses upper Donchian band (prior bar) the one candle price moves from below the Upper line of the previous candle to above it

"Above", "below", "is" and "rising" / "falling" stay true on every candle the state lasts, so they can fire many candles in a row. "Crosses" and "flips" fire once, on the candle it happens, so you get one signal per move.

Warnings you may see

  • "…compares the price with the current bar's Donchian band, which includes this bar's high / low: it can never be crossed.": the current upper band is the highest high including this candle, so price can never get above it. Turn Lag on with 1 bar to compare with the previous candle's channel (a breakout). You can still save it.
  • "It can never be true: a cross happens on one candle, so it cannot happen on N candles in a row. Use 'within the last N candles' instead.": a "crosses" condition with a "… in a row" lookback of 2 or more. Switch the lookback to Within the last.
  • "Lower length must be between 1 and 1000" / "Lower length must be a whole number": shown in the condition editor when a condition's own value is out of range. Fix the number; the condition can't be saved until then.
  • "Upper length must be between 1 and 1000" / "Upper length must be a whole number": shown in the condition editor when a condition's own value is out of range. Fix the number; the condition can't be saved until then.

Where they show: on the Strategies page, open Create entry conditions / Edit entry conditions (or the exit ones). Each condition's messages appear right under it. The setting messages ("must be between", "whole number", "must be one of", "must be smaller than") start with the indicator's short name, for example "MACD: Fast must be between 1 and 1000", and keep the conditions from being saved until fixed. The other warnings never block saving and are repeated in the strategy's Entry or Exit section, starting with the condition's name.

Good to know

  • It is worked out from each candle's high and low (not volume).
  • The ready-made breakouts compare price with the previous candle's channel ("prior bar"), because the current channel includes the current candle and can never be crossed.
  • It needs some history before its value settles: the longer of the two lengths (20 at the defaults). Apathia loads that history for you.
  • Lower length and Upper length can differ (for example a 20-candle breakout in and a 10-candle exit).