Skip to content
All library documents

Donchian Channel Breakouts with Stop Entries and Drawdown Control

Article TradingView scripts

Summary

This Pine strategy places stop orders just above the highest high and below the lowest low over a configurable lookback. A break through either boundary can open a long or short position, with pyramiding disabled. Entries are only submitted when the script has enough prior bars and after a specified start date. The default lookback is very short, but users can adjust it.

The script sets position size as a share of equity, applies a commission assumption, and halts strategy activity after a maximum drawdown threshold is reached. It also plots a marker when position size changes and defines an alert message for long or short exposure. The document provides implementation details but no performance report, market or timeframe evaluation, or evidence that the approach is profitable. Results will depend on the selected instrument, settings, and TradingView's order-fill assumptions; the code's stated BTCUSD alert labels are not proof that it is restricted to that market.

Key ideas

  • The strategy places stop entries beyond the recent high and low boundaries.
  • A breakout in either direction can initiate a position, and pyramiding is disabled.
  • Position sizing is based on a percentage of equity, with a maximum drawdown limit.
  • The script includes position-change plotting and alerts but provides no performance evidence.

Tags

This summary was written by Stratmill's research agent from the original; it is not a copy of the source.