OPEN-SOURCE SCRIPT
Bollinger Squeezes (All-in-One)

This indicator is a faithful recreation of the popular Bollinger Squeeze studies found in the Sierra Chart platform. It bundles three specific calculation methods (Study IDs 221, 233, and 401) into a single, versatile script.
While standard Squeeze indicators on TradingView often use a generalized formula, this script strictly follows the logic documented by Sierra Chart to ensure the exact same visual and numerical output.
📊 Included Modes (Selectable via Settings)
You can switch between the following three modes in the settings menu without adding the indicator multiple times:
1. Squeeze 1 (Standard - SC ID 221)
The Classic Squeeze: This creates the histogram based on the Momentum of the price relative to the Moving Average.
Formula: It utilizes a Linear Regression of the difference between Price and the SMA to smooth the momentum histogram.
Visuals: 4-color histogram (Bright/Dark Green for rising/falling positive, Red/Dark Red for negative).
2. Squeeze 2 (Momentum - SC ID 233)
The Raw Momentum: This variation calculates momentum more directly.
Formula: It uses the raw difference (Price - SMA) without the Linear Regression smoothing found in ID 221.
Result: The histogram appears sharper and reacts faster to immediate price changes.
3. Squeeze 3 (Ratio - SC ID 401)
The Ratio View: Instead of price momentum, this mode visualizes the "Squeeze Intensity."
Formula: It calculates the ratio between the Bollinger Band width and the Keltner Channel width (BB Width / KC Width).
Visuals: A solid green histogram representing the ratio. The Squeeze Dots turn red when the ratio drops below the defined threshold (default 1.0), indicating that the Bollinger Bands are completely inside the Keltner Channels.
⚙️ Features & Settings
Mode Selection: Easily toggle between the three study types via a dropdown menu.
Squeeze Dots:
🔴 Red: Squeeze is ON (Low volatility, potential breakout incoming).
🟢 Green: Squeeze is OFF (Volatility expanded).
Full Customization:
Length (Standard: 20)
Bollinger Band Multiplier (Standard: 2.0)
Keltner Channel Multiplier (Standard: 2.0)
True Range Option: Toggle between True Range (ATR) or High-Low for Keltner Channels.
💡 How to use
Add the script to your chart. Open the settings to choose your preferred calculation method. If you want to replicate the "stacked" view often seen in Sierra Chart (showing all three at once), simply add this indicator to your chart three times and set each one to a different mode.
Disclaimer: This script is an independent replication intended for educational and analytical purposes to bridge the gap between Sierra Chart and TradingView.
Sierra Chart, best trading software, EVER!
With the best datafeet. Denali Exchange Data Feed.
While standard Squeeze indicators on TradingView often use a generalized formula, this script strictly follows the logic documented by Sierra Chart to ensure the exact same visual and numerical output.
📊 Included Modes (Selectable via Settings)
You can switch between the following three modes in the settings menu without adding the indicator multiple times:
1. Squeeze 1 (Standard - SC ID 221)
The Classic Squeeze: This creates the histogram based on the Momentum of the price relative to the Moving Average.
Formula: It utilizes a Linear Regression of the difference between Price and the SMA to smooth the momentum histogram.
Visuals: 4-color histogram (Bright/Dark Green for rising/falling positive, Red/Dark Red for negative).
2. Squeeze 2 (Momentum - SC ID 233)
The Raw Momentum: This variation calculates momentum more directly.
Formula: It uses the raw difference (Price - SMA) without the Linear Regression smoothing found in ID 221.
Result: The histogram appears sharper and reacts faster to immediate price changes.
3. Squeeze 3 (Ratio - SC ID 401)
The Ratio View: Instead of price momentum, this mode visualizes the "Squeeze Intensity."
Formula: It calculates the ratio between the Bollinger Band width and the Keltner Channel width (BB Width / KC Width).
Visuals: A solid green histogram representing the ratio. The Squeeze Dots turn red when the ratio drops below the defined threshold (default 1.0), indicating that the Bollinger Bands are completely inside the Keltner Channels.
⚙️ Features & Settings
Mode Selection: Easily toggle between the three study types via a dropdown menu.
Squeeze Dots:
🔴 Red: Squeeze is ON (Low volatility, potential breakout incoming).
🟢 Green: Squeeze is OFF (Volatility expanded).
Full Customization:
Length (Standard: 20)
Bollinger Band Multiplier (Standard: 2.0)
Keltner Channel Multiplier (Standard: 2.0)
True Range Option: Toggle between True Range (ATR) or High-Low for Keltner Channels.
💡 How to use
Add the script to your chart. Open the settings to choose your preferred calculation method. If you want to replicate the "stacked" view often seen in Sierra Chart (showing all three at once), simply add this indicator to your chart three times and set each one to a different mode.
Disclaimer: This script is an independent replication intended for educational and analytical purposes to bridge the gap between Sierra Chart and TradingView.
Sierra Chart, best trading software, EVER!
With the best datafeet. Denali Exchange Data Feed.
Mã nguồn mở
Theo đúng tinh thần TradingView, tác giả của tập lệnh này đã công bố nó dưới dạng mã nguồn mở, để các nhà giao dịch có thể xem xét và xác minh chức năng. Chúc mừng tác giả! Mặc dù bạn có thể sử dụng miễn phí, hãy nhớ rằng việc công bố lại mã phải tuân theo Nội quy.
Thông báo miễn trừ trách nhiệm
Thông tin và các ấn phẩm này không nhằm mục đích, và không cấu thành, lời khuyên hoặc khuyến nghị về tài chính, đầu tư, giao dịch hay các loại khác do TradingView cung cấp hoặc xác nhận. Đọc thêm tại Điều khoản Sử dụng.
Mã nguồn mở
Theo đúng tinh thần TradingView, tác giả của tập lệnh này đã công bố nó dưới dạng mã nguồn mở, để các nhà giao dịch có thể xem xét và xác minh chức năng. Chúc mừng tác giả! Mặc dù bạn có thể sử dụng miễn phí, hãy nhớ rằng việc công bố lại mã phải tuân theo Nội quy.
Thông báo miễn trừ trách nhiệm
Thông tin và các ấn phẩm này không nhằm mục đích, và không cấu thành, lời khuyên hoặc khuyến nghị về tài chính, đầu tư, giao dịch hay các loại khác do TradingView cung cấp hoặc xác nhận. Đọc thêm tại Điều khoản Sử dụng.