OPEN-SOURCE SCRIPT
Price Contraction / Expansion

1. Introduction
The Price Contraction / Expansion indicator highlights areas of market compression and volatility release by analyzing candle body size and volume behavior. It provides a fast, color-coded visualization to identify potential breakout zones, accumulation phases, or exhaustion movements.
This tool helps traders recognize when price action is tightening before a volatility expansion — a common precursor to strong directional moves.
2. Key Features
Dynamic body analysis: Compares each candle’s body size with a moving average to detect contraction (small bodies) and expansion (large bodies).
Volume confirmation: Measures whether volume is unusually high or low compared to its recent average, helping filter false breaks.
Color-coded system for clarity:
Yellow: Contraction with high volume (potential accumulation or strong activity).
Blue: Contraction with normal volume or expansion with low volume (neutral/reduced participation).
Green: Expansion in bullish candle (buyer dominance).
Red: Expansion in bearish candle (seller dominance).
Customizable parameters: Adjust body and volume averaging periods and thresholds to fit different market conditions or timeframes.
3. How to Use
Identify contraction zones: Look for blue or yellow bars to locate areas of price compression — these often precede breakouts or large movements.
Wait for expansion confirmation: A shift to green or red bars with increasing volume indicates that volatility is expanding and momentum is building.
Combine with context: Use this indicator alongside trend tools, liquidity zones, or moving averages to confirm directional bias and filter noise.
Adapt thresholds: In highly volatile markets, increase the “Threshold multiplier” to reduce false contraction signals.
This indicator is most effective for traders who focus on volatility behavior, market structure, and timing potential breakout opportunities.
The Price Contraction / Expansion indicator highlights areas of market compression and volatility release by analyzing candle body size and volume behavior. It provides a fast, color-coded visualization to identify potential breakout zones, accumulation phases, or exhaustion movements.
This tool helps traders recognize when price action is tightening before a volatility expansion — a common precursor to strong directional moves.
2. Key Features
Dynamic body analysis: Compares each candle’s body size with a moving average to detect contraction (small bodies) and expansion (large bodies).
Volume confirmation: Measures whether volume is unusually high or low compared to its recent average, helping filter false breaks.
Color-coded system for clarity:
Yellow: Contraction with high volume (potential accumulation or strong activity).
Blue: Contraction with normal volume or expansion with low volume (neutral/reduced participation).
Green: Expansion in bullish candle (buyer dominance).
Red: Expansion in bearish candle (seller dominance).
Customizable parameters: Adjust body and volume averaging periods and thresholds to fit different market conditions or timeframes.
3. How to Use
Identify contraction zones: Look for blue or yellow bars to locate areas of price compression — these often precede breakouts or large movements.
Wait for expansion confirmation: A shift to green or red bars with increasing volume indicates that volatility is expanding and momentum is building.
Combine with context: Use this indicator alongside trend tools, liquidity zones, or moving averages to confirm directional bias and filter noise.
Adapt thresholds: In highly volatile markets, increase the “Threshold multiplier” to reduce false contraction signals.
This indicator is most effective for traders who focus on volatility behavior, market structure, and timing potential breakout opportunities.
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.