OPEN-SOURCE SCRIPT

Volatility Compression Oscillator

This Pine Script v6 component is designed to identify periods of volatility compression, which often precede significant market moves.

Here's how it works:
  • Bollinger Bands Width (BBW): The script calculates the width of the Bollinger Bands across multiple timeframes (5m, 15m, 1h, daily) to detect periods of tightening.
  • Average True Range (ATR): The ATR is calculated for the same timeframes to identify declining volatility.
  • Compression Score: A numerical score is generated by averaging the BBW values and dividing by the sum of ATR values across the timeframes. This score indicates the level of volatility compression.
  • Alerts: Alerts are triggered when the compression score falls below a specified threshold, indicating a potential breakout or breakdown.
  • Visualization: The compression score is plotted on the chart, and periods of extreme compression are highlighted with a background color. If enabled, volume data is also plotted to confirm compression phases.


To use this component, add it to your TradingView chart. Adjust the input parameters to suit your analysis needs and monitor the compression score and alerts for potential trading opportunities.

Wyłączenie odpowiedzialności