Bollinger Bands SD
Jun 12, 2015

The Madrid Bollinger Bands SD indicator tracks the position of the price relative to the Bollinger Bands' standard deviation levels, providing a clean histogram-based map of trend strength and volatility.
Usage
The Madrid Bollinger Bands SD is used to identify the current zone in which price is trading relative to its moving average and standard deviation bands. Instead of overlaying bands on the price chart, it uses a histogram to categorize price position:
- +/- 1: Price is within the first standard deviation (the core trend).
- +/- 4: Price is between the first and second standard deviations.
- +/- 9: Price is beyond the second standard deviation, indicating overbought or oversold conditions.
Positive values indicate the price is above the basis (SMA), while negative values indicate the price is below. Traders can use this to gauge trend momentum and potential exhaustion points at a glance.
Details
The indicator calculates a Simple Moving Average (Basis) and two sets of Bollinger Bands at 1 and 2 standard deviations. The script evaluates the source price against these thresholds and assigns a specific integer value (1, 4, or 9) based on which zone the price occupies. This numerical representation makes it easier to quantify trend intensity compared to visual inspection of traditional bands.
Settings
- Source: Determines the price data used for the Bollinger Band calculations (e.g., Close, Open, HL2).
- Length: The lookback period for the Simple Moving Average (Basis) and the Standard Deviation calculation.
FAQ
How do I interpret the histogram values?
Values of 1 or -1 suggest a stable trend near the mean, values of 4 or -4 suggest increasing momentum, and values of 9 or -9 suggest extreme price extensions.
Can I set alerts for specific levels?
Yes, the script includes built-in alerts for basis crosses and when price enters the overbought or oversold zones (beyond 2 standard deviations).
How can I access Madrid Bollinger Bands SD?
You can get access on the LuxAlgo Library for charting platforms like TradingView, MetaTrader (MT4/MT5), and NinjaTrader for free.
Free indicator
Get free access to this indicator on the platforms below.
Unlock the entire LuxAlgo Library
Every indicator, every strategy, full charts, and complete access to Quant — our AI agent.