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 sumber terbuka
Dalam semangat TradingView sebenar, pencipta skrip ini telah menjadikannya sumber terbuka, jadi pedagang boleh menilai dan mengesahkan kefungsiannya. Terima kasih kepada penulis! Walaupuan anda boleh menggunakan secara percuma, ingat bahawa penerbitan semula kod ini tertakluk kepada Peraturan Dalaman.
Penafian
Maklumat dan penerbitan adalah tidak bertujuan, dan tidak membentuk, nasihat atau cadangan kewangan, pelaburan, dagangan atau jenis lain yang diberikan atau disahkan oleh TradingView. Baca lebih dalam Terma Penggunaan.
Skrip sumber terbuka
Dalam semangat TradingView sebenar, pencipta skrip ini telah menjadikannya sumber terbuka, jadi pedagang boleh menilai dan mengesahkan kefungsiannya. Terima kasih kepada penulis! Walaupuan anda boleh menggunakan secara percuma, ingat bahawa penerbitan semula kod ini tertakluk kepada Peraturan Dalaman.
Penafian
Maklumat dan penerbitan adalah tidak bertujuan, dan tidak membentuk, nasihat atau cadangan kewangan, pelaburan, dagangan atau jenis lain yang diberikan atau disahkan oleh TradingView. Baca lebih dalam Terma Penggunaan.