Donchian channel breakout
A Donchian channel breakout enters when price closes beyond the highest high or lowest low of the last N candles. It is fully mechanical, with essentially one setting, N. Its weakness is repeated false breakouts in ranging markets, so it needs testing on the market and timeframe you intend to trade, including N values around your chosen one.
What is the idea?
The upper line is the highest high of the last N candles and the lower line is the lowest low. A close above the upper line is a new N-period high, which a breakout strategy reads as a possible start of a trend. The mirror image applies to a close below the lower line.
It is a classic trend-following rule because it is simple and has almost no subjective content. There is no pattern to recognise and no zone to draw. Given N and a definition of a breakout, a computer and a person find exactly the same signals.
That simplicity cuts both ways. Trend-following rules like this tend to win rarely and by a lot, which means long losing streaks are normal for them and a handful of large trades carry the result. Whether you could tolerate that is as important as whether it is profitable on paper.
The rules, in order
- Compute the highest high and lowest low over the last N completed candles.
- Enter long when a candle closes above the upper line, and short when it closes below the lower line.
- Place a stop, commonly beyond the opposite side of a shorter channel or a multiple of average candle range.
- Exit on a defined rule: a close back through a shorter channel, a trailing stop, or a fixed multiple of the risk.
- Size every trade from the stop distance so each risks the same fraction of capital.
- Optionally trade only in one direction, or only when a slower trend filter agrees.
The settings the rules hide
Every setting below is a choice, and each one changes which trades the strategy takes. They have to be fixed before a test, and the more of them there are, the more room there is to fit the past.
| Setting | What it controls | Note |
|---|---|---|
| N (entry channel length) | How long a high or low must stand to count as a breakout | The one setting that matters most. A longer N finds fewer, larger trends. |
| Breakout definition | A close beyond the line, or any touch | A close filters wicks but enters later. |
| Exit rule | How a trade ends | Often matters more than the entry for the result. |
| Stop distance | Risk per unit | A wide channel means a wide stop and a small position. |
| Trend filter | Whether a slower condition gates trades | Another setting is another way to fit the past. |
What AKQX provides for this
AKQX's strategy library includes a Donchian breakout on a 20-period channel, which is a starting point for your own testing, not a recommendation. The Donchian channel is also an indicator in AKQX's newer strategy engine, with N as a configurable setting.
Backtests apply estimated fees and slippage to every trade and report expectancy, profit factor, maximum drawdown and trade count, which are the numbers a trend-following rule needs to be judged on.
How to backtest it honestly
- Test a range of N values, not one, and look at the shape of the results. A broad plateau is reassuring. One good value among poor ones is a fit.
- Run it on the market and timeframe you will actually trade. A 20-period channel on 5-minute candles and on daily candles are different strategies.
- Separate trending from ranging periods and compare. Expect poor results in the ranging ones, and judge whether the trends pay for them.
- Look at the longest losing streak and the maximum drawdown, not only profit. These rules often lose many trades in a row.
- Include costs. A rule that trades often on a fast timeframe pays them often.
- Check trade count against the 100-trade crypto minimum, then paper trade.
The full method is in how to backtest a crypto strategy, and the way results are scored is on the methodology page.
A worked example, with made-up numbers
Illustrative only: with N = 20 on daily candles, the highest high of the last 20 days is 110. A day closes at 110.5, so the rule buys. The stop is placed at the lowest low of the last 10 days, 106.5, so risk is 4 per unit. Over a long test the rule might take dozens of such trades, with most small losses and a few large wins. The test reports how many, how large, and how deep the worst losing run was.
Where it goes wrong
- Using the textbook value of N without checking it on your own market.
- Judging it on win rate. Low win rates are normal here.
- Testing only through one strong trend, which proves the rule works in a trend.
- Quitting after a losing streak that the backtest already contained.
Educational only. AKQX is software only. It is not a SEBI-registered Investment Adviser or Research Analyst and gives no investment advice or recommendations. Backtest and paper-trading results are simulated and do not guarantee future results. Crypto products are unregulated and can be highly risky, and there may be no regulatory recourse for any loss.
Questions about donchian breakout
What is a Donchian channel?
It plots the highest high and lowest low over the last N periods. A close beyond either edge is used as a breakout signal. The middle is sometimes drawn as the average of the two.
What is the best value of N?
There is none that works everywhere. It depends on the market and timeframe, which is why you test a range of values and look for a plateau instead of a single peak.
Is a low win rate a problem?
Not by itself. Trend-following rules commonly win a minority of trades and rely on a few large winners. What matters is expectancy, drawdown and whether you could stay with it through the losing runs.
Does AKQX recommend this strategy?
No. The library entry is a starting point for your own testing. AKQX gives no advice and makes no claim that any strategy is profitable.
Keep reading
Test it instead of taking it on trust
A free account includes 10 backtests a month and 1 paper algo, with no card and no broker connection.