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.
Skrip open-source
Dengan semangat TradingView yang sesungguhnya, pembuat skrip ini telah menjadikannya sebagai sumber terbuka, sehingga para trader dapat meninjau dan memverifikasi fungsinya. Salut untuk penulisnya! Meskipun Anda dapat menggunakannya secara gratis, perlu diingat bahwa penerbitan ulang kode ini tunduk pada Tata Tertib kami.
Pernyataan Penyangkalan
Informasi dan publikasi ini tidak dimaksudkan, dan bukan merupakan, saran atau rekomendasi keuangan, investasi, trading, atau jenis lainnya yang diberikan atau didukung oleh TradingView. Baca selengkapnya di Ketentuan Penggunaan.
Skrip open-source
Dengan semangat TradingView yang sesungguhnya, pembuat skrip ini telah menjadikannya sebagai sumber terbuka, sehingga para trader dapat meninjau dan memverifikasi fungsinya. Salut untuk penulisnya! Meskipun Anda dapat menggunakannya secara gratis, perlu diingat bahwa penerbitan ulang kode ini tunduk pada Tata Tertib kami.
Pernyataan Penyangkalan
Informasi dan publikasi ini tidak dimaksudkan, dan bukan merupakan, saran atau rekomendasi keuangan, investasi, trading, atau jenis lainnya yang diberikan atau didukung oleh TradingView. Baca selengkapnya di Ketentuan Penggunaan.