Williams’ VIX Fix Indicator for ThinkorSwim


The Williams’ VIX Fix indicator helps to measure volatility for individual stocks, similar to how the VIX does for the S&P 500 Index. Williams Vix Fix also includes a 20 Bollinger Bands indicating extremes in the signal line.

Some traders believe the Vix Fix indicator can find market bottoms in all instruments.


thinkScript Code

Rich (BB code):
# V1.0  - 052816 - Dilbert - 1st code cut
# VixFix is a pretty close approximation to the standard VIX or implied volatility.  It can be used on intraday chart aggregations, and on symbols that do not have options.  When VixFIX spikes high it provides some pretty good buy signals.
input OverSold = .1;  # .1 good for SPY 1 day 1 minute chart
input OverBought = .01;  # .01 good for SPY 1 day 1 minute chart
input LengthVF = 22;
input LengthMA = 20;
declare lower;
def C = close;
def L = low;
plot VixFix = (Highest (C, LengthVF) - L) / (Highest (C, LengthVF)) * 100;
plot OS = OverSold;
plot OB = OverBought;
Alert(VixFix crosses above OverSold, "VixFIX crosses above OverSold", Alert.Bar, Sound.Ring);
#Alert(VixFix > OverSold, "VixFIX > OverSold", Alert.TICK, Sound.Ring);

# BollingerBands code

input ShowBollingerBands = No;
input displace = 0;
input BBlength = 20;
input Num_Dev_Dn = -2.0;
input Num_Dev_up = 2.0;
input averageType = AverageType.Simple;

def sDev = stdev(data = VixFix[-displace], length = BBlength);
def MidLine = MovingAverage(averageType, data = VixFix[-displace], length = BBlength);

def LowerBand = MidLine + num_Dev_Dn * sDev;
def UpperBand = MidLine + num_Dev_Up * sDev;
plot LB = if ShowBollingerBands then LowerBand else Double.NaN;
plot UB = if ShowBollingerBands then UpperBand else Double.NaN;

VixFix.AssignValueColor(if VixFix > UpperBand then Color.Green else Color.Red);

input corrLength = 20;
def correlationWith = ImpVolatility();

plot CorrelationIV = correlation(VixFix, correlationWith, corrLength);
addlabel(yes, "Correlation w IV: "+ correlationIV,color.light_gray);

Shareable Link


thinkScript Code (Mobius)

Rich (BB code):
# Williams_Vix_Fix
# Mobius
# Addition of mean for easier reading.
# V01.2016
declare lower;

input n = 22;
plot WVF = (Highest (Close, n) - Low) / (Highest(Close, n)) * 100;

plot mean = inertiaAll(WVF);

addCloud(mean, WVF, color.green, color.red);

# End Code Williams Vix Fix

Shareable Link

Last edited:


Well-known member
2019 Donor
Ported CM_Williams_Vix_Fix Indicator - Helps find market bottoms, it looks interesting indicator to stop reversals.

Seems to work best with lower time frames. please explore and share your experiences :)


#ts_CMWilliamsVixFix_20190928 - CM_Williams_Vix_Fix Finds Market Bottoms
#Ported from https://www.tradingview.com/script/og7JPrRA-CM-Williams-Vix-Fix-Finds-Market-Bottoms/
#Original Author ChrisMoody
#Ported By diazlaz
#20190908.01 - Initial Release
#20190908.02 - Add ability to reverse logic and highlight potential tops

declare lower;

input colorCandles = yes; #hint Color Candles
input plotBottoms = yes; #hint Plot Bottoms if yes or Plots Tops if no.
input pd = 22; #hint LookBack Period Standard Deviation High
input bbl = 20; #hint Bolinger Band Length
input mult = 2.0; #hint Bollinger Band Standard Dev
input lb = 50; #hint Look Back Period Percentile High
input ph = .85; #hint Highest Percentile - 0.90=90%, 0.95=95%, 0.99=99%
input pl = 1.01; #hint Lowest Percentile - 1.10=90%, 1.05=95%, 1.01=99%
input hp = no; #hint Show High Range - Based on Percentile and LookBack Period?
input sd = no; #Show Standard Deviation Line?

def wvf = if plotBottoms then ((Highest(close, pd) - low) / (Highest(close, pd))) * 100 else
    ((Lowest(close, pd) - high) / (Lowest(close, pd))) * 100;
def sDev = mult * StDev(wvf, bbl);
def midLine = Average(wvf, bbl);
def lowerBand = midLine - sDev;
def upperBand = midLine + sDev;

def rangeHigh = (Highest(wvf, lb)) * ph;
def rangeLow = (Lowest(wvf, lb)) * pl;

plot pRH = (if hp and rangeHigh then rangeHigh else Double.NaN);

plot pRL = (if hp and rangeLow then rangeLow else Double.NaN);

plot pUB = (if sd and upperBand then upperBand else Double.NaN);

plot pWVF = wvf;
pWVF.SetPaintingStrategy(paintingStrategy = PaintingStrategy.HISTOGRAM);
pWVF.AssignValueColor(if wvf >= upperBand or wvf >= rangeHigh then Color.LIME else Color.GRAY);

   if colorCandles then     
      if wvf >= upperBand or wvf >= rangeHigh then Color.LIME else Color.GRAY
Last edited:


Thank you. I actually have this version and the enhanced one ready to go. Converted them to share with our Warehouse members 😂

Amazing work by the way. You beat me to it. 🎉

Since you already share the initial version I’ll drop the updated one sometimes next week. It has less signals but more reliable than this one.


Well-known member
2019 Donor
awesome - looking forward to it Ben! - been playing with the code, seems it does a damn good job also findings tops ;) - more experimentation and minor tweaks might be necessary, maybe you can take it further:

input plotBottoms = yes; #hint Plot Bottoms if yes or Plots Tops if no.
def wvf = if plotBottoms then ((Highest(close, pd) - low) / (Highest(close, pd))) * 100 else
((Lowest(close, pd) - high) / (Lowest(close, pd))) * 100;

if set to no, it flips the logic and highlights potential tops.


Last edited:


Well-known member
2019 Donor
i'm currently developing a trend indicator out of it (work in progress):


I think this has some potential of identifying reversals, or has an opportunity to provide a signal when it's a good time to go long or short interday, or can serve as a stop/reversal indicator, but it's going to need to be paired with an additional set of confirmation indicators. i'm curious to see what Ben comes up with to improve the signal. I think there is some value here when paired up.

Ideally so far, what I found, is that once the signals are exhausted (the last green bar), then it's a good time to trigger, otherwise it still early and could fall or increase further.

I will backtest this model and see if there is any edge just using it as a standalone and share the results shortly.


I plan on releasing this sometime next week, but @diazlaz was kind enough to port the first version to ThinkorSwim yesterday so I thought it would be fair to share this now, so there is no delay on the development of this indicator.


I recommend watching this video before using the indicator: http://vimeopro.com/user32804960/tradingview-indicators/video/115973132

thinkScript Code

# VIX_FIX v3 Major Update
# Based on Larry Williams' Vix Fix
# Assembled by BenTen at useThinkScript.com
# Converted from https://www.tradingview.com/script/pJpXG5JH-CM-Williams-Vix-Fix-V3-Ultimate-Filtered-Alerts/
# Video intro: https://vimeopro.com/user32804960/tradingview-indicators/video/115973132

# Discussion: https://usethinkscript.com/threads/williams%E2%80%99-vix-fix-indicator-for-thinkorswim.145/post-5467

input pd = 22;
input bbl = 20;
input mult = 2.0;
input lb = 50;
input ph = 0.85;
input pl = 1.01;

# Downtrend Criterias
input ltLB = 40;
input mtLB = 14;
input str = 3;

# Williams Vix Fix Formula
def wvf = ((highest(close, pd) - low) / (highest(close, pd))) * 100;
def sDev = mult * stdev(wvf, bbl);
def midLine = SimpleMovingAvg(wvf, bbl);
def lowerBand = midLine - sDev;
def upperBand = midLine + sDev;
def rangeHigh = (highest(wvf, lb)) * ph;

#  Filtered Bar Criteria
def upRange = low > low[1] and close > high[1];
def upRange_Aggr = close > close[1] and close > open[1];
#  Filtered Criteria
def filtered = ((wvf[1] >= upperBand[1] or wvf[1] >= rangeHigh[1]) and(wvf<upperBand and wvf<rangeHigh));
def filtered_Aggr = (wvf[1] >= upperBand[1] or wvf[1] >= rangeHigh[1]);

# Alerts Criteria
def alert1 = wvf >= upperBand or wvf >= rangeHigh;
def alert2 = (wvf[1] >= upperBand[1] or wvf[1] >= rangeHigh[1]) and (wvf < upperBand and wvf < rangeHigh);
def alert3 = upRange and close > close[str] and (close < close[ltLB] or close < close[mtLB]) and filtered;
def alert4 = upRange_Aggr and close > close[str] and (close < close[ltLB] or close < close[mtLB]) and filtered_Aggr;

AssignPriceColor(if alert4 then color.magenta else if alert3 then color.orange else if ((wvf[1] >= upperBand[1] or wvf[1] >= rangeHigh[1]) and (wvf < upperBand and wvf < rangeHigh)) then color.cyan else if (wvf >= upperBand or wvf >= rangeHigh) then color.lime else color.white);
Last edited:


Well-known member
Wow you guys are working hard on this! I am also testing something: Check out the simple add of
plot mean = inertia(inv_WVF,meanlength);
addCloud( inv_WVF,mean, color.green, color.red);
with 20 period, 50 mean. on daily
Last edited:


Well-known member
2019 Donor
Great find everyone! Looking at it, I think the logic that introduced in the video and in the enhanced filter, can be turned into a price action indicator and embed this logic in other indicators?



Active member
@john3 , if you watch the video, they explain why they use 22 for length.
spoiler alert:
that's how many trading days there are in most months.


Well-known member
2019 Donor
@diazlaz That could be possible 🤔
it made me think differently, if we all provide our insights, we can create a class of price action indicators, that is primarily driven by price action rather than a technical indicator, and then use this price action to compliment the technical indicators. really good reminder to have selection criteria also incorporate price.


Well-known member
I saw that. The question is what does it have to do with the CBOE's VIX?
Well the original creator idea was to create "VIX" like any indicator for any security (not just SPX). This indicator matches VIX somewhat ( if you apply original one to SPX) hence the name. But yeah while VIX is tied to put/call ratios this is just price range based

philosophy behind it that spikes in range change correlate with tops and bottoms


Well-known member
2019 Donor
Im liking Vix FIX so far the only draw back Ive found is the lower indicator takin up valuable real-estate on my laptop. is it possible to write the lower indicator onto the chart itself?

Ben, and all members your coding skills are superb and I thank everyone for your knowledgeable contributions. I probably spend more time on this site than I do reading newspapers lol.


Well-known member
@J007RMC Sure, see if this works: Click the Studies Beaker/Flask, Click & hold the lower study, Drag it to the upper. That should do it. :)

Similar threads