1Copy the scriptPress Copy script above, or the copy button on the code below.
2Open the Pine EditorOpen a TradingView chart and choose Pine Editor at the bottom of the screen.
3Paste over the templateCreate a new indicator, select all of the template text and paste. Press Save and give it a name.
4Add it to the chartPress Add to chart, then adjust the settings with the gear icon next to its name.
Source Code
25 lines of Pine Script v6 from tv-scripts/tvt-vix-squeeze.pine, published under MIT. Keep the author's credit and licence lines when you reuse it.
tvt-vix-squeeze.pine
//@version=6
indicator(title="[TVT] VIX Squeeze", shorttitle="[TVT] VIX-SQ", overlay=false)
// Fetch VIX high prices
vix_high = request.security("VIX", "", high)
// Input for Standard Deviation Length (defaulting to 20)
length = input.int(20, title="Standard Deviation Length", minval=1)
// Calculate Standard Deviation of high prices
high_stdev = ta.stdev(vix_high, length)
// Plot Standard Deviation
plot(high_stdev, title="VIX High Price StdDev", color=color.purple, linewidth=2)
// Thresholds
upper_threshold = input.float(10.0, title="Upper Threshold", minval=0.0)
lower_threshold = input.float(1.0, title="Lower Threshold", minval=0.0)
// Plot threshold lines using hline
hline(upper_threshold, "Upper Threshold", color=color.new(color.green, 2), linestyle=hline.style_solid)
hline(lower_threshold, "Lower Threshold", color=color.new(color.red, 2), linestyle=hline.style_solid)
// Highlight background when VIX std dev is below lower threshold
bgcolor(high_stdev < lower_threshold ? color.new(color.red, 90) : na, title="Low VIX StdDev Highlight")
Overview
[TVT] VIX Squeeze plots the resulting volatility metric in a separate pane alongside upper and lower threshold horizontal levels. When the standard deviation falls below the lower threshold, representing volatility compression, the indicator tints the chart background red. Settings allow customization of the standard deviation length and both threshold levels.
The inputs you can change from the gear icon on the chart. Defaults are the author's.
Setting
Type
Default
Variable
Standard Deviation Length
int
20
length
Upper Threshold
float
10.0
upper_threshold
Lower Threshold
float
1.0
lower_threshold
Third-party code. ForexR did not write, test or endorse this script, and the summary above was generated automatically from its code and README. Indicators describe the past, and a strategy's backtest can look better than live trading, especially when a script repaints. Check it in the Strategy Tester and on a demo account before you rely on it.
This indicator calculates the distribution of close-to-close percentage changes using rate of change on closing prices. It bins percentage changes into intervals of 0.25 percent increments from negative to positive values and plots a normalized cumulative hist
This indicator plots a Supertrend-based trend-following setup in a separate pane and skips conditions it treats as a sideways market. A volatility range is built from an ATR value, with RMA, SMA, EMA, or WMA smoothing, or from a fixed point distance. Optional
This indicator plots candle range and open-to-close movement as percentages in a separate pane. Range is the high-low difference divided by the low, and change is the close-open difference divided by the open. Both series draw as columns. Teal columns show ran
Calculates dynamic modeling values by applying a mathematical logistic differential equation to price change over a specified lookback length. It measures price momentum relative to the recent high-low price range. The script plots positive and negative logist
MACD-V is a volatility-normalized momentum indicator based on research by Alex Spiroglou. It calculates the standard MACD histogram and normalizes it by dividing by the Average True Range (ATR). Plotted in a separate pane as a colored histogram, it includes us
This indicator detects a Bollinger Band squeeze when the bands sit inside Keltner Channels, marking low volatility. It plots red dots during a squeeze and green dots when the bands are outside, in a separate pane. An optional histogram shows momentum as the cl