OPEN-SOURCE SCRIPT
Squeeze Momentum Indicator

This indicator identifies periods of low market volatility—commonly referred to as a "squeeze"—by comparing Bollinger Bands and Keltner Channels. When volatility compresses, price often prepares for a directional breakout. The histogram visualizes momentum strength and direction once the squeeze ends.
**How it works:**
- **Squeeze detection**: A squeeze is active when Bollinger Bands are fully contained within Keltner Channels. This appears as black crosses on the zero line.
- **Volatility expansion**: When Bollinger Bands move outside Keltner Channels, volatility is increasing. This state is marked with blue crosses.
- **Momentum histogram**: The core signal is a linear regression of price relative to a dynamic baseline (average of the highest high, lowest low, and SMA over the lookback period).
- **Aqua**: Positive momentum that is accelerating.
- **Bright blue**: Positive momentum that is decelerating.
- **Yellow**: Negative momentum that is accelerating downward.
- **Orange**: Negative momentum that is decelerating (potential reversal zone).
**Usage notes:**
Traders often monitor the transition from squeeze (black) to expansion (blue) combined with a strong histogram move away from zero as a potential entry signal. Color changes in the histogram help assess momentum shifts before price makes large moves.
This script is designed for educational and analytical purposes. It does not constitute investment advice. Always test strategies in a simulated environment before applying them to live trading.
**How it works:**
- **Squeeze detection**: A squeeze is active when Bollinger Bands are fully contained within Keltner Channels. This appears as black crosses on the zero line.
- **Volatility expansion**: When Bollinger Bands move outside Keltner Channels, volatility is increasing. This state is marked with blue crosses.
- **Momentum histogram**: The core signal is a linear regression of price relative to a dynamic baseline (average of the highest high, lowest low, and SMA over the lookback period).
- **Aqua**: Positive momentum that is accelerating.
- **Bright blue**: Positive momentum that is decelerating.
- **Yellow**: Negative momentum that is accelerating downward.
- **Orange**: Negative momentum that is decelerating (potential reversal zone).
**Usage notes:**
Traders often monitor the transition from squeeze (black) to expansion (blue) combined with a strong histogram move away from zero as a potential entry signal. Color changes in the histogram help assess momentum shifts before price makes large moves.
This script is designed for educational and analytical purposes. It does not constitute investment advice. Always test strategies in a simulated environment before applying them to live trading.
Open-source script
In true TradingView spirit, the creator of this script has made it open-source, so that traders can review and verify its functionality. Kudos to the author! While you can use it for free, remember that republishing the code is subject to our House Rules.
Disclaimer
The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.
Open-source script
In true TradingView spirit, the creator of this script has made it open-source, so that traders can review and verify its functionality. Kudos to the author! While you can use it for free, remember that republishing the code is subject to our House Rules.
Disclaimer
The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.