← Script Marketplace
Open-source scriptindicator/v1

Bollinger Bands

by Kodexius·@kodexius·

Visualize price volatility around a configurable moving average with upper and lower Bollinger Bands.

#bollinger-bands#trend#volatility
Bollinger Bands chart preview
Open-source script. Everyone can inspect the source code, use the script on a chart, and save an editable copy.

About this script

Classic Bollinger Bands plotted directly over price. Configure the lookback length and standard-deviation multiplier to evaluate volatility expansion, contraction, and price location around the basis.

Source code
mpl-2.0
// Volatility bands around a moving average
indicator("Bollinger Bands", { overlay: true });

const len = input.number("Length", 20, { min: 2, max: 200 });
const mult = input.number("Multiplier", 2, { min: 0.5, max: 5, step: 0.1 });
const [basis, upper, lower] = bb(close, len, mult);

plot(upper, { title: "Upper Band", color: "#f59e0b" });
plot(basis, { title: "Basis", color: "#94a3b8" });
plot(lower, { title: "Lower Band", color: "#f59e0b" });

Release notes

Initial official release.