What this script is trying to do
Jayadev Rana published Entropy-Driven Squeeze for free so traders can understand compression, expansion, VWAP-relative momentum, impulsive BOS confirmation, and displacement zones in a cleaner structured way.
Traders who want to separate noisy chop from real expansion, and buyers who want proof that Jayadev can convert advanced market-behavior ideas into usable Pine Script tools.
This script is built to separate choppy compression from directional expansion, then pair that state with a normalized momentum read. The oscillator runs in its own pane, while structural break markers and displacement zones can be projected on the main chart using overlay drawings.
The squeeze logic is based on price efficiency over a user-defined lookback. When price travels a short net distance relative to the total path taken, the script treats that condition as a higher-chaos compression state. When efficiency improves, the script shifts toward expansion. Momentum is then measured as the distance between price and VWAP, smoothed with an EMA and normalized by ATR.
How it works
- It calculates an efficiency ratio over the selected lookback to estimate whether price is compressing or expanding. - It measures momentum as the smoothed distance between price and VWAP. - It normalizes momentum with ATR so the histogram is easier to compare across changing volatility conditions. - It flags impulsive candles when the current range exceeds an ATR-based displacement threshold. - It tracks recent 20-bar highs and lows, then marks an impulsive BOS only when price closes through one of those levels during a displacement candle. - It can draw simple displacement boxes on the chart when those BOS events occur.
How to use it
- Use the histogram to read directional momentum relative to VWAP. - Use the pulse marker and background highlight to identify tighter compression phases. - Use impulsive BOS markers as confirmation that expansion has started with enough range to matter. - Treat the displacement boxes as reaction zones for follow-through or retest analysis, not as automatic trade signals.
Limitations and notes
- The script uses an efficiency-ratio style squeeze model. It is entropy-inspired, but it is not a formal statistical entropy calculation. - BOS detection is based on recent rolling highs and lows, so signals depend on the selected lookback and current candle expansion. - The displacement boxes are simplified visual zones built from the impulsive break area. - This script is a decision-support tool. It does not guarantee future market direction or trading performance.