Concept

Donchian Trend Rules

Donchian Trend Rules are Trend concepts. The Library holds 1 implementation, a working definition you can pull into Quant.

Top Donchian Trend Rules indicator

The top custom implementation, built on the original standard Donchian Trend Rules formula.

1 total

The Donchian Trend Rules implementation below can become a backtested trading strategy — describe your rules and Quant writes the code.

What are Donchian Trend Rules?

Donchian Trend Rules are the mechanical trend-following rules built on channel breakouts: go long when price makes a new N-period high, and exit or reverse when it makes a new M-period low (mirrored for shorts). The levels come from Donchian Channels, which plot the highest high and lowest low of a lookback window. Richard Donchian, widely regarded as the father of trend following, traded the canonical form in the 1950s and 60s as the weekly rule: buy a breakout above the prior four weeks' high, sell below the prior four weeks' low, always in the market.

The design choice that distinguishes the later variants is asymmetric lookbacks. A longer entry channel (20 or 55 days in the Turtle variants taught by Richard Dennis and William Eckhardt) demands a meaningful new extreme before committing, while a shorter exit channel (10 or 20 days) surrenders less open profit when the trend ends. The rules do not predict; they participate. They accept frequent small whipsaw losses in ranging markets in exchange for holding through the occasional extended trend, so risk sizing and diversification carry as much weight as the signal itself.

How to apply Donchian Trend Rules

The rules are fully mechanical, which makes them unambiguous to backtest. A standard long-side pass looks like this (shorts mirror it):

  1. 1Pick an entry lookback N and plot the channel: the highest high and lowest low of the last N completed bars. Donchian's weekly rule used four weeks; the documented Turtle systems used 20-day and 55-day entries.
  2. 2Define the trigger. Decide in advance whether an intrabar touch of the upper band or a close beyond it constitutes the breakout, then enter long when it happens. Using the prior bar's channel avoids triggering on a level the current bar itself is creating.
  3. 3Exit on the opposite extreme of a shorter window M: for example, a 20-day entry paired with a 10-day-low exit. Some variants reverse into a short at the same point rather than going flat.
  4. 4Add the risk layer: an initial stop (the published Turtle rules placed it two ATR units from entry) and position sizing scaled to ATR, since raw channel breakouts fail often when the market is ranging.

How it's calculated

Donchian channel breakout rules: a new n-bar high opens or maintains a long trend, a new n-bar low a short trend.

Uppert=max(Hi),i=tn to t1\operatorname{Upper}_t = \max(H_i), \quad i = t - n \text{ to } t - 1
Lowert=min(Li),i=tn to t1\operatorname{Lower}_t = \min(L_i), \quad i = t - n \text{ to } t - 1
Midt=Uppert+Lowert2\operatorname{Mid}_t = \frac{\operatorname{Upper}_t + \operatorname{Lower}_t}{2}
Long entry: Ct>Uppert\text{Long entry: } C_t > \operatorname{Upper}_t
Short entry: Ct<Lowert\text{Short entry: } C_t < \operatorname{Lower}_t
Long exit: Ct<min(Li),i=tm to t1\text{Long exit: } C_t < \min(L_i), \quad i = t - m \text{ to } t - 1
Short exit: Ct>max(Hi),i=tm to t1\text{Short exit: } C_t > \max(H_i), \quad i = t - m \text{ to } t - 1
Upper_t: Donchian upper band, the highest high of the prior n bars
Lower_t: Donchian lower band, the lowest low of the prior n bars
Mid_t: channel midline
H: bar high
L: bar low
C_t: close of bar t
n: entry lookback in bars (commonly 20)
m: exit lookback in bars (commonly 10)
t: current bar index
i: bar index inside the lookback

Richard Donchian's four-week rule is the 20-day version run as stop-and-reverse; the Turtle rules pair a 20-day entry with a 10-day exit (System 1) and a 55-day entry with a 20-day exit (System 2).

Bands here use the prior n bars so a breakout is well defined; plotted Donchian channels often include the current bar.

Some versions trigger intrabar when the high or low touches the band instead of waiting for the close.

How traders use it

  • As a complete always-in or long-flat system: enter on the N-period breakout, exit on the shorter opposite-extreme break, and take every signal, since skipping one can mean missing the rare trend that would have offset a long run of small whipsaw losses.
  • As a standalone trailing exit: the lower band of a short-lookback channel works as a trailing stop for longs regardless of how the trade was entered, one of the classic options in the trailing method taxonomy.
  • As a trend filter: whether the most recent N-period breakout was up or down classifies market direction (a simple trend regime label) that can gate entries from other tools.
  • As a scan: fresh 20-day or 55-day highs and lows across a watchlist surface the symbols where a Donchian-style entry is currently live.

Donchian Trend Rules vs similar concepts

Donchian Channels: The channel is the indicator; the trend rules are the trading logic on top. You can plot the channel purely as support and resistance, while the rules add which band triggers entry, which shorter band exits, and what happens between signals.

Supertrend: Both flip between bullish and bearish regimes, but Supertrend flips when price crosses an ATR-based band around a midpoint, while Donchian rules trigger only on a new N-period extreme. Donchian entries need a fresh high or low; Supertrend can flip inside the prior range.

Turtle Soup: The deliberate fade of these rules. Turtle Soup sells a failed 20-day breakout back into the range, betting the new extreme is a false breakout rather than the start of a trend. Same level, opposite thesis.

Concept family

Trend

100 concepts mapped · 100 in the Library

Donchian Trend Rules FAQ

Turn Donchian Trend Rules into a trading strategy.

Take the implementation from this page into Quant, then build on it, backtest it on real data, and keep refining it in conversation.