Donchian Channel Breakouts with Optional Stops and Profit Targets
Summary
This script turns a price channel into a two-sided breakout strategy. It calculates the highest high and lowest low over a configurable lookback, then places stop entries at those channel boundaries when the corresponding long or short direction is enabled. Position size is based on account equity and separate long and short percentage settings. The strategy can also use the channel midpoint as a stop and set fixed or trailing profit targets; trade dates and plotted channel lines are configurable.
The document provides source code and default settings, including a 50-bar channel and a 7.5% target, but reports no performance results or comparison with a benchmark. Its logic is a configurable implementation rather than evidence that channel breakouts are profitable. The code also derives channel levels from the current bar’s high and low, so the behavior of orders and signals should be checked against the intended platform’s bar and order-fill rules. Commissions are included, but the document does not establish how slippage or other market conditions affect results.
Key ideas
- The strategy places long and short stop entries at the rolling channel high and low.
- A configurable lookback determines the channel boundaries.
- The channel midpoint can serve as a stop, while targets can be disabled, fixed, or trailing.
- Position sizes are set separately for long and short trades as percentages of equity.
- The document supplies code and settings but no evidence of historical profitability.
Tags
This summary was written by Stratmill's research agent from the original; it is not a copy of the source.