1Copy the scriptPress Copy script above. It reads the file straight from GitHub.
2Open the Pine EditorOpen a TradingView chart and choose Pine Editor at the bottom of the screen.
3Paste over the templateCreate a new strategy, select all of the template text and paste. Press Save and give it a name.
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.
Rolling highest-high and lowest-low breakout detection
Configurable percentage breakout buffer and bar confirmation
The inputs you can change from the gear icon on the chart. Defaults are the author's.
Setting
Type
Default
Variable
Lookback Period
int
20
lookbackPeriod
Breakout Buffer (%)
float
0.0
breakoutBuffer
Confirmation Bars
int
1
confirmBars
Volume Filter
bool
true
useVolumeFilter
Volume Multiplier
float
1.5
volumeMultiplier
ATR Filter
bool
true
useATRFilter
ATR Length
int
14
atrLength
Min ATR Multiplier
float
0.5
minATRMultiplier
Use Stop Loss
bool
true
useStopLoss
Stop Loss Type
string
ATR
stopLossType
Stop Loss ATR Multiplier
float
2.0
stopLossATR
Stop Loss %
float
2.0
stopLossPercent
Show all 16 settings
Setting
Type
Default
Variable
Use Take Profit
bool
true
useTakeProfit
Take Profit R:R
float
2.0
takeProfitRR
Long Only
bool
false
longOnly
Short Only
bool
false
shortOnly
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.
Calculates standard Bollinger Bands and identifies band expansion breakouts where upper and lower bands move in opposite directions. It enters long positions when price breaks above the upper band with a high candle body percentage, and enters short positions
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
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
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
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
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