Indicator · Pine Script v6 · On the chart

V18 Donchian Channel Breakout

by snoozie-v

An indicator for one-hour charts that plots a Donchian channel from the highest high and lowest low over a set number of bars.

View on GitHub

GitHub stars1on the repository
Pine versionv6current
Lines of code364
Settings9inputs
LicenceNone stated
Last update7 months ago13 Mar 2026

Add It to Your TradingView Chart

  1. 1Copy the scriptPress Copy script above. It reads the file straight from GitHub.
  2. 2Open the Pine EditorOpen a TradingView chart and choose Pine Editor at the bottom of the screen.
  3. 3Paste over the templateCreate a new indicator, select all of the template text and paste. Press Save and give it a name.
  4. 4Add it to the chartPress Add to chart, then adjust the settings with the gear icon next to its name.

Source Code

The code stays on GitHub. The author has not published this script under an open licence, so ForexR does not show its code. Copy script reads the file straight from GitHub into your clipboard, so you can still try it on your own chart. Ask the author before reusing the code anywhere else.

Overview

A close beyond the prior channel edge marks a long or short breakout, and an ATR-multiple trailing stop line tracks the exit. An optional regime filter uses a daily EMA slope and four-hour ATR rank to block counter-trend entries. Channel fill, trail line and trade labels can each be toggled.

Details

Published by

snoozie-v on GitHub

Type

Indicator, Pine Script v6

Draws

On the price chart

Category

Breakout, Trend, Volatility & bands

Markets

Crypto

Timeframes

M15-H1

Risk Notes

No repainting, lookahead or stacked entries were found in its code or README. That says nothing about how well it works: test it first.

Settings

The inputs you can change from the gear icon on the chart. Defaults are the author's.

SettingTypeDefaultVariable
Channel Period (1H bars)int78channel_period
ATR Trailing Stop Multiplierfloat6.25atr_trail_mult
ATR Periodint14atr_period
Show Donchian Channelbooltrueshow_channel
Show Channel Fillbooltrueshow_channel_fill
Show Trailing Stop Linebooltrueshow_trail_stop
Show Trade Plan Labelsbooltrueshow_trade_labels
Show Exit Labelsbooltrueshow_exit_labels
Enable Trend Filterbooltrueuse_regime_filter
Third-party code. ForexR did not write, test or endorse this script, and the summary above was generated automatically from its code and README. Indicators describe the past, and a strategy's backtest can look better than live trading, especially when a script repaints. Check it in the Strategy Tester and on a demo account before you rely on it.

Similar Pine Scripts

114 stars

This indicator adapts Michael Chalek's Dual Thrust trading concept to plot breakout levels and overlay bands directly on the price chart. It calculates lookback ranges based on historical price action and provides two algorithmic variations along with multiple

Indicator v4 TrendBreakout Repaints
Updated 1 year ago · None stated GitHub repository of Dual Thrust Trading Algorithm

The Market Tradability Engine calculates multi-factor tradability, balance, compression, and direction scores to evaluate market regime quality. It classifies market conditions into eight distinct states, including Balance, Compression, Ready, Breakout, Trend,

Indicator v6 TrendVolatility & bands
Updated 2 days ago · MIT GitHub repository of Market Tradability Engine [WavesUnchained]

GainzAlgo V2 Alpha

by Bakomebandias
8 stars

This overlay indicator scores breakouts of recent highs and lows against failed-breakout checks, EMA trend alignment, RSI momentum, and an ATR volatility band. It plots green buy and red sell labels when conditions pass a minimum score, and it prints ATR-based

Indicator v6 TrendOscillators & momentum
Updated 6 months ago · None stated GitHub repository of GainzAlgo V2 Alpha
3 stars

Greeffer's Long Study calculates Donchian Channels alongside a volume moving average filter to generate trade signals. When price touches the lower or upper channel boundaries combined with volume exceeding a custom moving average multiplier, the indicator tri

Indicator v4 TrendVolatility & bands
Updated 4 years ago · CC0-1.0 GitHub repository of Greeffer's Long Study

Bollinger Bands

by Web3Degenerate
2 stars

This overlay indicator plots customized asymmetrical Bollinger Bands on the price chart to detect breakout trade signals. It calculates a middle simple moving average and standard deviation bands using separate standard deviation multipliers for upper and lowe

Indicator v5 Volatility & bandsBreakout
Updated 2 years ago · None stated GitHub repository of Bollinger Bands

More indicators

Trade Your Charts With a Regulated Broker

Compare brokers that connect to TradingView, with spreads, minimum deposits and leverage side by side.

Compare brokers