CCI and Bollinger Bands
Sep 27, 2018

The CCI and Bollinger Bands indicator combines the Commodity Channel Index (CCI) with Bollinger Bands applied directly to the CCI values, providing a comprehensive momentum and volatility analysis tool.
Usage
The Usage section focuses on identifying overextended market conditions and momentum shifts. Traders can use the indicator to spot potential reversals when the CCI line crosses outside the Bollinger Bands or key horizontal levels (±100).
- Momentum Confirmation: When the CCI value is above the upper Bollinger Band and the +100 level, it suggests strong bullish momentum. Conversely, values below the lower band and -100 indicate strong bearish momentum.
- Volatility Analysis: The width of the Bollinger Bands on the CCI reflects the volatility of the oscillator itself, helping to filter out noise during low-volatility periods.
- Level Crossings: Visual circle markers appear at the ±100 levels to highlight when the CCI crosses these significant thresholds, often used to signal trend entries or exits.
Details
This script calculates a standard CCI based on a user-defined length and source. It then applies the Bollinger Bands formula (Simple Moving Average and Standard Deviation) specifically to the resulting CCI values rather than price. This allows the bands to act as dynamic overbought and oversold thresholds that adapt to the oscillator's recent range.
Settings
- CCI length: The lookback period for the Commodity Channel Index calculation.
- CCI source: The price input used for the CCI (e.g., Close, HL2, HLC3).
- BB length: The period used for the Simple Moving Average and Standard Deviation of the Bollinger Bands.
- Deviations σ: The multiplier for the standard deviation that determines the width of the Bollinger Bands.
- add 8 lines: A toggle to display additional horizontal reference levels.
- line 1-4: Customizable positive values for the horizontal reference lines; the script automatically plots their negative counterparts as well.
FAQ
How do I interpret the colors of the CCI line?
The CCI line and the Bollinger Band fill change color based on the position of the CCI relative to the bands and the center line. Green tones typically represent bullish positioning above the basis, while red tones represent bearish positioning below it.
What do the circles at the 100 levels represent?
The circles are automated alerts/markers that appear when the CCI crosses above or below the +100 and -100 levels, signaling a potential change in trend strength or a breakout.
How can I access this indicator?
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.