rumpypumpydumpy

Candle-Box Ratio

Volatility compression/expansion indicator calculated from the ratio of the area of the candles to the area of a rectangle encompassing the candles over n bars.

Generally during a squeeze or compression the ratio between the candles and the rectangular area increases, ie the candles occupy a larger portion of the rectangle, and vice versa during a release/expansion. It is inherently low lag due to the lack of any averaging in the calculation since the start of an expansion/breakout will instantly change the dimensions of the encompassing rectangle and the corresponding ratio. A potential downside is that different lengths will produce significantly different results which will require tuning to optimize for specific instruments and timeframes.

Additional standard deviation bands to identify potential points of volatility change and the option to normalize the output using the stdev bands.
Open-source script

In true TradingView spirit, the author of this script has published it open-source, so traders can understand and verify it. Cheers to the author! You may use it for free, but reuse of this code in a publication is governed by House Rules. You can favorite it to use it on a chart.

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.

Want to use this script on a chart?