This overlay indicator calculates Bollinger Bands from a rolling mean and standard deviation and Keltner Channels from a simple moving average plus ATR-smoothed true range.
1Copy the scriptPress Copy script above, or the copy button on the code below.
2Open the Pine EditorOpen a TradingView chart and choose Pine Editor at the bottom of the screen.
3Paste over the templateCreate a new indicator, select all of the template text and paste. Press Save and give it a name.
4Add it to the chartPress Add to chart, then adjust the settings with the gear icon next to its name.
Source Code
151 lines of Pine Script v6 from lib/oscillators/bbs/bbs.pine, published under Apache-2.0. Keep the author's credit and licence lines when you reuse it.
A dedicated function returns whether a squeeze is on, the bandwidth, and the band and channel values. Periods, standard-deviation and ATR multipliers, and the price source are adjustable, and bands or channels can be hidden. It draws on the price chart and does not define entries, exits, or a stop loss.
The inputs you can change from the gear icon on the chart. Defaults are the author's.
Setting
Type
Default
Variable
Bollinger Band Period
int
20
i_bb_period
BB StdDev Multiplier
float
2.0
i_bb_mult
Keltner Channel Period
int
20
i_kc_period
KC ATR Multiplier
float
1.5
i_kc_mult
Source
source
close
i_source
Show Bands
bool
true
i_show_bands
Show Channels
bool
true
i_show_channels
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 indicator plots an ATR-based Chandelier Exit trailing stop on the price chart. It tracks a long stop under recent highs and a short stop above recent lows, then switches direction when price crosses the opposite stop. Buy and sell labels mark those flips.
This overlay indicator marks ICT liquidity void fills on the price chart and can show long and short signals. It places a Fibonacci level inside a displacement candle, defaulting to the midpoint, and draws lines in a chosen style. Optional filters limit the fi
This indicator plots trade entry and exit signals on the price chart by combining Bollinger Bands with optional filter conditions. It calculates standard Bollinger Bands along with RSI, Aroon, and moving average filters. Reversal signals trigger when price bre
This indicator calculates an ATR trailing stop line derived from the highest high minus an average true range multiple over a specified lookback period. It plots the trailing stop line directly on the price chart and colors price bars based on whether the clos
This indicator plots three exponential moving averages and ATR volatility envelopes on the price chart. It compares the fast and slow EMAs to shade a trend ribbon and marks confirmed upward and downward crossovers with triangle labels. Settings change the thre
This indicator calculates an outlier-filtered moving average based on statistical filtering concepts. It stores close prices in a rolling array over a user-defined length, calculates the mean and standard deviation, and excludes values falling within a specifi