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.
Script de código abierto
Fiel al espíritu de TradingView, el creador de este script lo ha convertido en código abierto, para que los traders puedan revisar y verificar su funcionalidad. ¡Enhorabuena al autor! Aunque puede utilizarlo de forma gratuita, recuerde que la republicación del código está sujeta a nuestras Normas internas.
Exención de responsabilidad
La información y las publicaciones no constituyen, ni deben considerarse como asesoramiento o recomendaciones financieras, de inversión, de trading o de otro tipo proporcionadas o respaldadas por TradingView. Más información en Condiciones de uso.
Script de código abierto
Fiel al espíritu de TradingView, el creador de este script lo ha convertido en código abierto, para que los traders puedan revisar y verificar su funcionalidad. ¡Enhorabuena al autor! Aunque puede utilizarlo de forma gratuita, recuerde que la republicación del código está sujeta a nuestras Normas internas.
Exención de responsabilidad
La información y las publicaciones no constituyen, ni deben considerarse como asesoramiento o recomendaciones financieras, de inversión, de trading o de otro tipo proporcionadas o respaldadas por TradingView. Más información en Condiciones de uso.