Function Bollinger Bands and Squeeze
Sep 14, 2019

The Function Bollinger Bands and Squeeze indicator provides a comprehensive volatility analysis tool that combines traditional Bollinger Bands with a specialized Money Flow Index (MFI) based squeeze detector. It aims to help traders identify periods of market consolidation and impending volatility expansion by analyzing the relationship between price action, volume, and band width.
Usage
The Usage section focuses on identifying market states through the visual cues provided on the chart. The tool plots standard Bollinger Bands consisting of a basis line (EMA), an upper band, and a lower band. These are used to gauge price relative to a moving average and measure current market volatility.
A unique feature of this tool is the integrated squeeze detector. When the market enters a period of low volatility and consolidation (a "stagnant market"), the area between the Bollinger Bands is highlighted with a specific squeeze color (yellow). This visual indication suggests that a volatility breakout may be imminent. Traders can use the expansion of the bands following a squeeze to identify the start of a new trend.
Details
The script utilizes a proprietary modeling approach to detect squeezes. Instead of just looking at the raw Bollinger Band Width (BBW), it incorporates volume by calculating a "Bollinger Band Width Money Flow Index." This involves:
- Calculating a short-period BBW to detect rapid changes in risk/volatility.
- Applying an RSI-like calculation to the BBW change weighted by volume.
- Determining the "odds" of a trend being active versus stagnant based on the interaction between the BBW and volume flow.
By integrating volume, the script attempts to filter out low-volatility periods that lack the necessary accumulation/distribution characteristics of a true squeeze.
Settings
- T_BB: Defines the period used for the main Bollinger Bands and the internal risk detection logic.
- MULTIPLIER: Sets the standard deviation multiplier for the upper and lower bands.
- LENGTH_MFI: Determines the length used for the Money Flow Index calculation applied to the band width.
- COLOR_UP: Customizes the color of the upper Bollinger Band.
- COLOR_DN: Customizes the color of the lower Bollinger Band.
- COLOR_NEUTRAL: Sets the color for the basis line and the default background fill.
- COLOR_SQUEEZE: Sets the color used to highlight the background during a detected squeeze.
FAQ
How do I access Function Bollinger Bands and Squeeze? You can get access on the LuxAlgo Library for charting platforms like TradingView, MetaTrader (MT4/MT5), and NinjaTrader for free.
What does the yellow background fill mean? The yellow fill indicates a "Stagnant Market" or squeeze condition, where volatility has dropped significantly and a potential breakout is being monitored based on the BBW and volume flow.
Can I use this for trend following? Yes, while the tool detects squeezes, the bands themselves serve as dynamic support and resistance. A breakout from a squeeze condition often signals the start of a strong directional trend.
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.