Donchian Channel Strategy Optimization for TradingView
Optimize Donchian Channel strategy parameters on TradingView with Pineify grid search. Test channel period, entry type, and exit rules across thousands of combinations.
Add to Chrome FreeBuilding a Donchian Channel Strategy
Donchian Channel is a trend-following indicator developed by Richard Donchian, often called the father of trend following. It plots the highest high and lowest low over a specified period, creating an envelope around price action. A classic breakout strategy enters long when price touches or crosses above the upper channel, and short when it crosses below the lower channel. The channel width naturally expands during volatility and contracts during calm periods, giving the strategy an adaptive quality.
The key parameters that drive Donchian Channel strategy performance are: the channel period (how many bars the high and low look back), the entry trigger (upper only, lower only, or both sides), the exit timing (holding for a fixed number of bars), and optional width filters that skip trades when the channel is too narrow. Each of these interacts with the market structure in ways that are not always obvious.
Optimizable Parameters
| Parameter | Description | Typical Range |
|---|---|---|
| Channel Period | Number of bars used for the highest high and lowest low | 10 - 50 (step 5) |
| Entry Type | Which channel side triggers a trade: upper, lower, or both | upper / lower / both |
| Exit Bars | Number of bars to hold a position before exiting | 5 - 30 (step 5) |
| Channel Width Filter | Minimum channel width as percentage of price to enter a trade | 1% - 5% (step 0.5%) |
Real Optimization Run
I ran a grid search on Donchian Channel strategy with period 10-50 (step 5), entry type upper/lower/both, exit bars 10-30 (step 5), and width filter 1-4% (step 0.5%) across ETHUSD daily. That is 9 x 3 x 5 x 7 = 945 combinations. The optimization ran in about 12 minutes. Best result used period 20, both sides entry, exit after 15 bars, and 2.5% width filter with a profit factor of 1.8 over 4 years. What surprised me is that adding the width filter actually reduced total trades by 40% but doubled the average win. Not sure that will hold on every pair though. I also noticed the both-sides entry did better in ranging markets than upper-only, which makes sense but I was not expecting the gap to be that wide. It was nearly a 30% difference in Sharpe.
Frequently Asked Questions
Related Strategy Optimizations
Start Optimizing Your Donchian Channel Strategy
Download Pineify Supercharged for free and run your first grid search optimization in minutes.
Add to Chrome Free