Inverted Vix Fix with Deviation Bands for ThinkorSwim


Well-known member
With the recent interest in Vix and Vix Fix I found a study on a forum reply. So no idea of original author. I changed the study which plotted the William's Vix Fix formula and dev. bands to an inverted plot. To me much easier to read then normal a vix type plot. Also posting for those who prefer an actual plot to interpret rather than just going off an arrow or candle color. The principles of trading bands should also work here in a more visually logical format.

# Changed the existing study, author not listed to an inverted Vix Fix.
# Changes by Horserider 9/28/2019
# Original study notation below:
#hint period: The number of bars used to calculate the VIX <b>(Default is 10)</b>
#hint Num_Dev_Up: The amount of stdev up. <b>(Default is 1.645</b>, 90% probability)
#hint Num_Dev_Dn: The amount of stdev down.<b>(Default is -1.645</b>, 90% probability)

declare lower;

input period = 10;
input Num_Dev_Up  = 1.645;
input Num_Dev_Dn = -1.645;

def WVF = (Highest(close, period) - low) / (Highest(close, period)) * 100;
plot inv_WVF = - WVF;

def sDev = stdev(data = inv_WVF, period);
def MidLine = Average(data = inv_WVF, period);

plot LowerBand = MidLine + num_Dev_Dn * sDev;

plot UpperBand = MidLine + num_Dev_Up * sDev;

LowerBand.SetDefaultColor(CreateColor(0, 224, 0));
inv_WVF.SetDefaultColor(CreateColor(221, 18, 255));
UpperBand.SetDefaultColor(CreateColor(224, 0, 0));

AddCloud(UpperBand, LowerBand, Color.LIGHT_GRAY);

Just finished the study and played a bit with inputs on 5 Min and 55 period looked good. Feel free to play with inputs and please share any great ones you find.
Last edited:


Well-known member
2019 Donor
@horserider cool stuff - i'm also playing around with it. seems like it has good potential and could be purpose for a number of different ways.

Overlaying with it on a 21 period on a 1 minute chart (currently focus on 1mins and 5 mins, I need to move up to higher time frames and get out of this craziness of scalping the market :) )

Buy the cross of lower band and see the upper cross back to the mean could be something there.


Well-known member
@netarchitech Thanks for the kind words. Yes I did see your links in the other post and then worked on this indicator. I did not want to use two studies to find high and low areas and for me having to do the reverse is not intuitive. hahaha easily confused. I need to look at your new links as doing the indicator was easy, knowing how to trade with it needs clarification.

No I had not seen BenTen post of it. Will take a look.


Well-known member
Thanks for the kind words.

You are certainly welcome :)

...doing the indicator was easy, knowing how to trade with it needs clarification.

I hear that...Plenty of times I cranked out something that looked so promising, only to find myself on the wrong side of the trade because I didn't spend the requisite time to clarify, as you say...That's one of the reasons why I moved to higher timeframes...I found myself with more time to desk-check, backtest and work the Risk/Money Management numbers. With that said, I now have to find the patience to give higher timeframe opportunities room to breathe...Alas, there's always something to deal with...

Good Luck and Good Trading :)


Well-known member
Due to the love of arrows and candle coloring I threw together some arrows for the study. Up arrows at low and down arrows at high according to the Chris Moody filter criteria as shown in the video from the other Vix Fix post.

I am sure you will need to play with the settings of the period and look backs to have the study and arrows match you time frame of trading. The arrows are not tested in live trading so if you try it report back any success or failure please. That will help everyone. Add this code to the above study code for the arrows;

# Set up arrows

input ltLB = 40;
input mtLB = 14;
input str = 3;

def upRange_Aggr = close > close[1] and close > open[1];
def filtered_Aggr = (inv_WVF <= LowerBand );

def alert4 = upRange_Aggr and close > close[str] and (close < close[ltLB] or close < close[mtLB]) and filtered_Aggr ;

plot  up = if upRange_Aggr and close > close[str] and(close < close[ltLB] or close < close[mtLB]) and filtered_Aggr then alert4 else double.NaN ;


def downRange_Aggr = close < close[1] and close < open[1];
def filtereddwn_Aggr = (inv_WVF >= upperBand );

def alertdw = downRange_Aggr and close < close[str] and (close > close[ltLB] or close > close[mtLB]) and filtereddwn_Aggr ;

plot  down = if downRange_Aggr and close < close[str] and(close > close[ltLB] or close > close[mtLB]) and filtereddwn_Aggr then alertdw else double.NaN ;

Last edited:


New member
Thank you. The arrows are almost impossible to see as they are at the top of the lower box. Anyway to make it visible? Especially the down arrows.


Well-known member
Just looked through my files, Mobius had posted a Vix Fix some time ago. Load this against the /ES on a daily aggregation.
It sure looks interesting. Please enjoy this

# 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,,;

# End Code Williams Vix Fix


Active member
2019 Donor
@horserider In your first screengrab at the top, the price seems to be painted according to your inverted VixFix (the lower study). Would you please post the code that does the price painting? Thank you.

Similar threads