Skip to content
All library documents

Donchian Breakout Trading with ATR Risk Stops and Trailing Exits

Code Quant course library

Summary

This strategy uses hourly bars to trade breakouts from Donchian channels. When flat, it places stop orders at the upper and lower boundaries of a longer channel, using average true range (ATR) to set trade size. Its risk allocation is divided by twice the ATR, linking position size to recent price movement. The channel lookbacks and ATR period are configurable.

After an entry, the strategy records the fill price and sets an initial protective stop two ATRs away. It tracks the highest and lowest prices reached during the trade, then combines a shorter Donchian channel exit with a trailing threshold four ATRs from that extreme. The document includes a historical test setup for a bitcoin perpetual-style contract and configures a genetic search to maximize the Sharpe ratio. It does not report test results, specify a complete end date, or discuss robustness, transaction-cost sensitivity, or safeguards for live trading; the sizing formula also omits explicit contract-value adjustments.

Key ideas

  • Entry orders trigger at the upper or lower boundary of a longer lookback Donchian channel.
  • Position size is set by dividing a fixed risk budget by twice the current ATR.
  • An initial stop is placed two ATRs from the recorded entry price.
  • Exits combine a shorter Donchian channel boundary with a four-ATR trailing threshold.
  • The strategy exposes its channel and ATR lookbacks for optimization against Sharpe ratio.

Tags

Cited by

From a private course collection; the original is not published.