Bollinger Bands (Nadaraya Smoothed)
Nov 6, 2023

The Bollinger Bands (Nadaraya Smoothed) indicator provides an advanced version of traditional Bollinger Bands by applying Nadaraya-Watson kernel smoothing to reduce noise while maintaining accurate price tracking. This tool aims to help traders identify outlier price movements and periods of consolidation with a superior smoothness-to-fit ratio compared to standard moving average smoothing techniques.
Usage
The indicator can be used to identify potential trend reversals or overextended price conditions. When the price moves outside the smoothed bands, it is often interpreted as an abnormal movement or a potential mean-reversion opportunity.
- Outlier Detection: Use the labels (triangles) to spot where price breaks the primary volatility bands.
- Consolidation: Narrowing bands indicate periods of low volatility or consolidation.
- Smoothing Factor (Bandwidth): Adjusting this value changes the reactivity of the bands. A lower bandwidth makes the indicator more reactive to recent price changes, while a higher bandwidth provides a smoother, more generalized view of volatility.
- Repaint Smoothing: When enabled, the indicator recalculates based on the full lookback window to provide a perfectly smooth estimation, which is useful for historical analysis of discrete data.
Details
Traditional Bollinger Bands rely on simple moving averages and standard deviations, which can often appear "jagged" due to sudden price spikes. This script implements the Nadaraya-Watson estimator—a non-parametric regression technique—using a Gaussian kernel.
Each data point's weight in the smoothing process is determined by its distance from the current point via the kernel function. This localized weighting allows the bands to filter out "noise" (minute fluctuations) without the significant lag or distortion typically associated with high-period SMA or EMA smoothing.
Settings
Smoothing
- Smoothing Factor: Sets the bandwidth (h) for the Nadaraya-Watson estimator. Higher values result in smoother lines, while lower values track the original Bollinger data more closely.
- Repaint Smoothing: Toggles whether the estimation should recalculate on every chart update for maximum smoothness.
Bollinger Bands Settings
- Period (Short, Medium, Long): Defines the lookback period for the standard deviation calculations for three different band levels.
- Deviation (Short, Medium, Long): Sets the multiplier for the standard deviation to determine the width of each band level.
Plots and Labels
- Label Source: Choose between Pivots, Close, or High/Low to determine what price action triggers the breakout labels.
- Labels: Toggles the visibility of the bearish (triangle down) and bullish (triangle up) breakout markers.
- Plot Lines: Enables or disables the primary smoothed Bollinger Band lines.
- Level 1 & 2 Bands: Toggles the visibility of the filled volatility zones between different standard deviation levels.
FAQ
How do I access Bollinger Bands (Nadaraya Smoothed)?
You can get access on the LuxAlgo Library for charting platforms like TradingView, MetaTrader (MT4/MT5), and NinjaTrader for free.
What is the difference between this and regular Bollinger Bands?
Regular Bollinger Bands use a simple moving average, which can be laggy or noisy. This version uses a Gaussian kernel smoothing technique to provide a cleaner visual representation of volatility without sacrificing accuracy.
Why do the labels move when I use the Pivot source?
The Pivot source setting has a built-in four-bar delay to confirm the high or low point, ensuring the label is placed accurately on a confirmed pivot rather than a temporary price spike.
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.