//@version=6
// PipAtlas Bollinger Bands — a 20-period moving average with bands two standard
// deviations away, plus an honest note about what a band tag does not mean.
// Education only, never financial advice.
// https://pipatlas.com
indicator("PipAtlas Bollinger Bands", shorttitle = "PA BB", overlay = true)
len = input.int(20, "Period", minval = 2, maxval = 500)
mult = input.float(2.0, "Deviations", minval = 0.5, maxval = 5.0, step = 0.1)
src = input.source(close, "Source")
showFill = input.bool(true, "Shade the band")
// Basis is the SMA of the source; the bands sit mult deviations away. TradingView's
// ta.stdev is the population form, which is what the MT4/MT5 builds of this
// indicator use too, so all three platforms line up bar for bar.
basis = ta.sma(src, len)
dev = mult * ta.stdev(src, len)
upper = basis + dev
lower = basis - dev
pU = plot(upper, "Upper band", color = color.new(color.red, 20), linewidth = 1)
pL = plot(lower, "Lower band", color = color.new(color.red, 20), linewidth = 1)
plot(basis, "Basis", color = color.new(color.blue, 0), linewidth = 2, style = plot.style_line)
fill(pU, pL, color = showFill ? color.new(color.blue, 93) : na, title = "Band fill")
// A close outside a band is a statement about how far price travelled relative to
// its own recent noise. It is not a reversal signal: in a trend, price rides the
// upper or lower band for weeks at a time.
tagUp = ta.crossover(close, upper)
tagDn = ta.crossunder(close, lower)
plotshape(tagUp, title = "Closed above the upper band", style = shape.triangledown, location = location.abovebar, color = color.new(color.maroon, 0), size = size.tiny)
plotshape(tagDn, title = "Closed below the lower band", style = shape.triangleup, location = location.belowbar, color = color.new(color.teal, 0), size = size.tiny)
// Band width, in percent of the basis, is the volatility read most traders are
// actually looking for when they stare at the bands.
bw = basis != 0 ? (upper - lower) / basis * 100.0 : na
plot(bw, "Band width %", display = display.data_window)
alertcondition(tagUp, "Close above upper band", "PipAtlas Bollinger: price closed above the upper band")
alertcondition(tagDn, "Close below lower band", "PipAtlas Bollinger: price closed below the lower band")
Overview
PipAtlas Bollinger Bands plots the upper band, lower band, and basis line on the main price chart with optional background shading between the outer bands. Small triangle shapes signal when price closes above the upper band or below the lower band. Inputs allow adjusting the period length, standard deviation multiplier, price source, and background shading toggle.
Standard Bollinger Bands plot with background shading
The inputs you can change from the gear icon on the chart. Defaults are the author's.
Setting
Type
Default
Variable
Period
int
20
len
Deviations
float
2.0
mult
Source
source
close
src
Shade the band
bool
true
showFill
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 standard Bollinger Bands and three configurable moving averages directly on the price chart. Users can toggle the Bollinger Bands, adjust their length and multiplier, and choose between exponential or simple moving averages for fast, slow,
This indicator plots four customizable moving averages directly on the main price chart using default lengths of 3, 8, 21, and 50 periods. It fills the space between adjacent averages in green or maroon depending on trend alignment. Additionally, it computes B
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 modifies standard Bollinger Bands to measure directional trend force based on line alignment. It calculates a simple moving average basis along with upper and lower volatility bands. When all three lines move upward or downward simultaneously, i
This indicator overlays trend-following Supertrend bands on the price chart using Average True Range calculations. It plots trailing stop lines, highlights active trend directions, and prints buy or sell shape labels when price closes across band thresholds. I
This indicator calculates Kaufman's Adaptive Moving Average (KAMA) on a chosen price source and determines trend direction based on the slope across a configurable lookback window. Signals can be filtered by short-term volatility expansion using ATR comparison