Type/to search

Donchian Channel Breakout Strategy

Cryptocurrency
Created: 2023-09-14 14:44:44
Last modified: 3 years ago
1
Follow
1781
Followers

Strategy Logic

The Donchian channel breakout strategy is a trend following strategy based on the Donchian channel. It uses the highest high and lowest low over specified periods to determine entry and stop loss points for long and short positions.

The entry rules are: go long when the price breaks above the highest high over a lookback period (e.g. 20 days), and go short when the price breaks below the lowest low over another lookback period (e.g. 10 days).

The EXIT rules are: Long positions are stopped out at the middle or lower band of the channel; short positions are stopped out at the middle or upper band. The middle band is the average of the highest high and lowest low over a specified period (e.g. 10 days).

For example, trading BTCUSDT with the following parameters:

  • Long entry lookback period: 20 days
  • Long stop loss lookback period: 10 days
  • Stop loss at middle band: Yes
  • Short entry lookback period: 10 days
  • Short stop loss lookback period: 20 days
  • Stop loss at middle band: Yes

The entry and stop rules would be:

  • Go long when price breaks above the 20-day high
  • Long stop loss at midpoint of 10-day high and low
  • Go short when price breaks below 10-day low
  • Short stop loss at midpoint of 20-day high and low

By dynamically adjusting the lookback periods, the strategy can be optimized across market cycles to capture trends with better reward/risk.

Advantages

  • Breakouts can identify trend direction early on
  • Stop losses close to price help manage risk
  • Flexible parameters allow optimization for different cycles

Risks

  • Breakouts prone to whipsaws, need to confirm validity
  • Close stop losses susceptible to shakeouts in choppy markets
  • Poor parameter tuning could lead to over-trading or insufficient stops

Summary

The Donchian channel breakout uses breakouts to identify trends, with channel midpoints/bands as stops to control risk. Optimizing lookback periods can improve trend capture in strong moves. However, caution is needed on breakout validity and shakeouts. Overall this strategy suits mid- to long-term trend trading, but may struggle in choppy markets.

Source
Pine
/*backtest
start: 2023-08-14 00:00:00
end: 2023-09-13 00:00:00
period: 2h
basePeriod: 15m
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/

//@version=4
strategy("Donchian Channel Strategy", overlay=true, default_qty_type= strategy.percent_of_equity, initial_capital = 1000, default_qty_value = 20, commission_type=strategy.commission.percent, commission_value=0.036)

//Long optopns
Strategy parameters
Strategy parameters
Channel Period for Long enter position
Channel Period for Long exit position
Is exit on Base Line? If 'no' - exit on bottom line
Take Profit (%) for Long position
Allow Long?
Channel Period for Short enter position
Channel Period for Short exit position
Is exit on Base Line? If 'no' - exit on upper line
Take Profit (%) for Short position
Allow Short?
Test Start Year
Test Start Month
Test Start Day
Test End Year
Test End Month
Test End Day
Comment
All comments (0)
No data
No data
  • 1
iPhone Download
Forums
PINE Language
© 2015 - ∞ INVENTOR PTE LTD (SG)