01
How It Works
- Track the highest and lowest close of the previous 20 bars — the Donchian channel.
- Buy when today's close beats the 20-bar high: price has just done something it hasn't managed in the whole window, often the start of a trend.
- Sell when the close falls below the 20-bar low, handing the trend back once the range breaks the other way.
Worked example. The highest close of the previous 20 bars is 104. Today's close prints 104.8 — a breakout — so the strategy buys. Weeks later the 20-bar low has risen to 110 and a sell-off closes at 109.5, below it, closing the trade around +4.5%.
02
The Math Behind The Indicators
Everything runs on closing prices of the traded timeframe: P is a close, Pt today's close, and N counts bars — one bar is one candle of that timeframe, so 20 bars on a 1h chart is 20 hours.
- Price Channel (Rolling High / Low)
- The highest and lowest close over the previous N bars — the edges of the recent trading range. Closing above the channel top means price just beat every close in that window (a breakout); the channel bottom marks recent support.
- UpperN = max(Pt-1, …, Pt-N), LowerN = min(Pt-1, …, Pt-N)
- Example: If the previous 5 closes were 100, 103, 101, 102, 104, the channel spans 100 to 104. A close at 105 breaks above the top; a close at 99 breaks below the bottom.
03
Example Chart
Example Chart
04
Real Data
49/ 100Composite scoreMetrics Per Trade
Final Metrics
Scores
05