Williams’ VIX Fix Indicator for ThinkorSwim

BenTen

Administrative
Staff member
Staff
VIP
Lifetime
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.

2gevOQt.png


thinkScript Code

Rich (BB code):
#Dilbert_VixFix
# 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;
#VixFix.AssignValueColor(Color.GREEN);
plot OS = OverSold;
OS.AssignValueColor(Color.CYAN);
plot OB = OverBought;
OB.AssignValueColor(Color.CYAN);
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;
LB.SetDefaultColor(GetColor(0));
UB.SetDefaultColor(GetColor(5));


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

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

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

Shareable Link

https://tos.mx/yAq7s5

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;
     WVF.SetDefaultColor(Color.Cyan);

plot mean = inertiaAll(WVF);
     mean.SetDefaultColor(Color.Gray);

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

# End Code Williams Vix Fix

Shareable Link

https://tos.mx/5HigXD
 

Attachments

  • 2gevOQt.png
    2gevOQt.png
    80.1 KB · Views: 565
Last edited:

Join useThinkScript to post your question to a community of 21,000+ developers and traders.

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 :)

hCc8Vtp.png


Code:
#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);
pRH.SetLineWeight(2);
pRH.AssignValueColor(Color.ORANGE);

plot pRL = (if hp and rangeLow then rangeLow else Double.NaN);
pRL.SetLineWeight(2);
pRL.AssignValueColor(Color.ORANGE);

plot pUB = (if sd and upperBand then upperBand else Double.NaN);
pUB.SetLineWeight(2);
pUB.AssignValueColor(Color.ORANGE);

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

AssignPriceColor(
   if colorCandles then     
      if wvf >= upperBand or wvf >= rangeHigh then Color.LIME else Color.GRAY
   else
      Color.CURRENT
);
 

Attachments

  • hCc8Vtp.png
    hCc8Vtp.png
    159.4 KB · Views: 415
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.
 
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.

Tops

cDz2X3w.png
 

Attachments

  • cDz2X3w.png
    cDz2X3w.png
    165.5 KB · Views: 291
Last edited:
i'm currently developing a trend indicator out of it (work in progress):

vn3Drg2.png


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.
 

Attachments

  • vn3Drg2.png
    vn3Drg2.png
    224.9 KB · Views: 453
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.

FILTERED ENTRIES -- Plus AGGRESSIVE FILTERED ENTRIES - HIGHLIGHT BARS AND ALERTS

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

thinkScript Code

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:
@john3

William’s VIX Fix is a synthetic VIX(CBOE Volatility Index) calculation which can be used in any market to mimic the performance (but not the quotes) of the well-known volatility index (the WVF is not based on option’s implied volatility but derived from historical and intraday prices only).

More on that here: https://m.benzinga.com/article/458117
 
Wow you guys are working hard on this! I am also testing something: Check out the simple add of
Code:
plot mean = inertia(inv_WVF,meanlength);
     mean.SetDefaultColor(Color.Gray);
addCloud( inv_WVF,mean, color.green, color.red);
with 20 period, 50 mean. on daily
 
Last edited:
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?

Thoughts?
 
@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.
 
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
 
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.
 

Similar threads

Not the exact question you're looking for?

Start a new thread and receive assistance from our community.

87k+ Posts
295 Online
Create Post

Similar threads

Similar threads

The Market Trading Game Changer

Join 2,500+ subscribers inside the useThinkScript VIP Membership Club
  • Exclusive indicators
  • Proven strategies & setups
  • Private Discord community
  • ‘Buy The Dip’ signal alerts
  • Exclusive members-only content
  • Add-ons and resources
  • 1 full year of unlimited support

Frequently Asked Questions

What is useThinkScript?

useThinkScript is the #1 community of stock market investors using indicators and other tools to power their trading strategies. Traders of all skill levels use our forums to learn about scripting and indicators, help each other, and discover new ways to gain an edge in the markets.

How do I get started?

We get it. Our forum can be intimidating, if not overwhelming. With thousands of topics, tens of thousands of posts, our community has created an incredibly deep knowledge base for stock traders. No one can ever exhaust every resource provided on our site.

If you are new, or just looking for guidance, here are some helpful links to get you started.

What are the benefits of VIP Membership?
VIP members get exclusive access to these proven and tested premium indicators: Buy the Dip, Advanced Market Moves 2.0, Take Profit, and Volatility Trading Range. In addition, VIP members get access to over 50 VIP-only custom indicators, add-ons, and strategies, private VIP-only forums, private Discord channel to discuss trades and strategies in real-time, customer support, trade alerts, and much more. Learn all about VIP membership here.
How can I access the premium indicators?
To access the premium indicators, which are plug and play ready, sign up for VIP membership here.
Back
Top