Strategy · Pine Script v6 · On the chart

Breakout Strategy Template

by TradersPost

This strategy detects price breakouts above rolling highest highs or below lowest lows over a customizable lookback period.

View on GitHub

GitHub stars218on the repository
Pine versionv6current
Lines of code134
Settings16inputs
LicenceNone stated
Last update3 months ago23 Jul 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 strategy, select all of the template text and paste. Press Save and give it a name.
  4. 4Add it to the chartPress Add to chart. The trades and results appear in the Strategy Tester tab; adjust the settings with the gear icon.

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

Breakout Strategy Template includes optional volume spike and ATR volatility threshold filters, along with bar confirmation rules. Positions are taken upon confirmed breakouts and exited using configurable risk-to-reward take profits and stop losses based on ATR, fixed percentage, or swing levels. The script plots on the main price chart.

Details

Published by

TradersPost on GitHub

Type

Strategy, Pine Script v6

Draws

On the price chart

Category

Breakout, Volatility & bands

Markets

Any symbol

Timeframes

Any timeframe

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
Lookback Periodint20lookbackPeriod
Breakout Buffer (%)float0.0breakoutBuffer
Confirmation Barsint1confirmBars
Volume FilterbooltrueuseVolumeFilter
Volume Multiplierfloat1.5volumeMultiplier
ATR FilterbooltrueuseATRFilter
ATR Lengthint14atrLength
Min ATR Multiplierfloat0.5minATRMultiplier
Use Stop LossbooltrueuseStopLoss
Stop Loss TypestringATRstopLossType
Stop Loss ATR Multiplierfloat2.0stopLossATR
Stop Loss %float2.0stopLossPercent
Show all 16 settings
SettingTypeDefaultVariable
Use Take ProfitbooltrueuseTakeProfit
Take Profit R:Rfloat2.0takeProfitRR
Long OnlyboolfalselongOnly
Short OnlyboolfalseshortOnly
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

257 stars

This strategy plots VWMA-based Bollinger bands on the 1-minute ES futures price chart for volatility analysis and potential breakout identification. It calculates dynamic long and short stop loss and take profit levels using percentage inputs relative to entry

Strategy v6 Volatility & bandsSupport & resistance
Updated 6 weeks ago · None stated GitHub repository of V1.6 ES - Futures 1M No Repaint

Bollinger Breakout

by hackingthemarkets
189 stars

This price-chart strategy plots a simple moving average and upper and lower bands built from the standard deviation of close, scaled by separate offset inputs. It enters a fixed quantity long when close crosses above the upper band and a fixed quantity short w

Strategy v4 Volatility & bandsBreakout
Updated 3 years ago · None stated GitHub repository of Bollinger Breakout

2 Candles Inside ATR

by hasnocool
106 stars

2 Candles Inside ATR is an overlay script that measures volatility compression across two consecutive candles. It calculates a smoothed Average True Range (ATR) and compares it against the combined high and low range of the current and previous bars. When the

Strategy v4 Volatility & bandsBreakout
Updated 2 years ago · GPL-3.0 GitHub repository of 2 Candles Inside ATR

均线突破交易系统

by tangly1024
76 stars

This strategy trades long breakouts of a fast and a slow moving average on the price chart. It opens a long position when price crosses above either average, using a percentage of equity as size. It reduces the position by a set share when the high reaches the

Strategy v5 TrendMoving averages
Updated 4 months ago · None stated GitHub repository of 均线突破交易系统

Bollinger bands examples

by tradingstrategy-ai
53 stars

This strategy plots exponential-moving-average Bollinger bands on the price chart and calculates RSI. It opens a long position when close crosses above the upper band while RSI is at or above a threshold, the date filter allows trading, and no position is open

Strategy v5 Volatility & bandsOscillators & momentum
Updated 3 years ago · None stated GitHub repository of Bollinger bands examples

More strategys

Trade Your Charts With a Regulated Broker

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

Compare brokers