Indicator · Donchian Channels
Donchian Channel Backtester
The Donchian channel is the highest high and lowest low of the last N candles. It is the simplest indicator on any platform, it is the core of the most famous trend-following experiment ever run, and it is a superb first backtest precisely because there is nothing in it to fudge.

A rule with nowhere to hide
Buy a new N-candle high, sell a new N-candle low, exit on the opposite channel. There is no parameter to optimise except N, no interpretation, and no room for the hindsight that makes most backtests worthless. If the rule loses money on your instrument, the backtest will say so within a hundred trades and there will be no argument available.
That is also why it's the right test to run first: it calibrates you. Once you've watched a mechanically perfect rule lose eight in a row during a range, every subsequent backtest you run will be more honest.
Breakout systems and the losing-streak problem
Channel breakout systems are low win rate by design — often well under 40% — and they make their money on a small number of very large trends. Every backtest of one must therefore report the longest losing streak, not just the average, because the streak is what makes people abandon the system three trades before it pays.
Run your measured win rate through the risk of ruin calculator before you decide it's tradeable. A 35% win rate with 3R winners is a fine business and a genuinely uncomfortable ride.
Frequently asked questions
What lookback does it use?
20 candles by default, editable to anything from 1 to 500 — the classic Turtle variants used 20 and 55, and testing both is a two-minute job.
Does it include the mid-line?
Yes, the channel draws the upper, lower and mid lines, so exits on the midpoint are testable as well as exits on the opposite band.
Which markets suit channel breakouts?
Historically, the ones that trend hard and persistently — commodities and currencies more than mean-reverting indices. That's a claim you can check yourself: run the identical rule on oil, gold and the S&P and compare.
Open WTI crude with Donchian channels on
One click — hourly oil, the rolling high and low plotted, candle by candle.
Open the chart →