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
Bollinger Bands computes the middle band as the simple moving average of the close price over the input length and the upper and lower bands by multiplying the standard deviation by the multiplier and adding or subtracting from the middle band. Long signals trigger when price crosses below the lower band with a stop loss placed at the lower band; short signals trigger on crossover above the upper band with a stop loss at the upper band. The strategy cancels the opposite position on each new signal and uses fixed-percentage equity position sizing. Settings adjust the period, deviation multiplier, and trade direction. No take-profit rules exist beyond the band-based stop loss.
The inputs you can change from the gear icon on the chart. Defaults are the author's.
Setting
Type
Default
Variable
length
int
30
length
mult
float
3.0
mult
Strategy Direction
int
0
direction
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.
This strategy combines two sets of Bollinger Bands with a Laguerre RSI oscillator plotted on the price chart. It generates buy and sell signals when price touches the upper or lower bands or zones. The strategy allows enabling or disabling entries and includes
This strategy plots Bollinger Bands on the price chart with adjustable length, standard deviation, and offset. It defines buy and sell zones using candle size percentage and body size thresholds. Long positions enter when the lower zone is breached without con
This overlay strategy is built for ES futures on the one-minute chart. It plots a volume-weighted moving average of price opens and standard-deviation bands at Fibonacci ratios, plus a second longer volume-weighted average from a higher-timeframe open. Call an
The Mean Reversion Strategy Template calculates a baseline mean using SMA, EMA, or VWAP alongside upper and lower deviation bands based on standard deviation, ATR, or percentage offsets. It generates long and short entries when price touches, bounces from, or
This strategy backtests a long Bollinger Band deal on the price chart for 3Commas-style bots. It plots short and long simple moving averages, offset bands, and the average entry price of the open deal. A long starts when price crosses the lower band inside a c
This strategy generates buy and sell signals based on Bollinger Band crossovers combined with a simple moving average trend filter. It enters a long position when price crosses above the lower band while trading above the SMA filter line, and enters a short po