Inverted Vix Fix with Deviation Bands for ThinkorSwim

H

horserider

Well-known member
VIP
Warehouse
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.

Code:
# 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;
inv_WVF.HideBubble();

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

plot LowerBand = MidLine + num_Dev_Dn * sDev;
LowerBand.HideBubble();

plot UpperBand = MidLine + num_Dev_Up * sDev;
UpperBand.HideBubble();

LowerBand.SetDefaultColor(CreateColor(0, 224, 0));
inv_WVF.SetDefaultColor(CreateColor(221, 18, 255));
inv_WVF.SetLineWeight(2);
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:
netarchitech

netarchitech

Member
@horserider Nicely done! The inversion definitely helps and the candle coloring does too...

I don't know if you are aware (I wasn't), but @BenTen posted another version of the VIX Fix also...

Good Luck and Good Trading :)
 
D

diazlaz

Member
VIP
Warehouse
@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.
 
H

horserider

Well-known member
VIP
Warehouse
@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.
 
netarchitech

netarchitech

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

horserider

Well-known member
VIP
Warehouse
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. http://vimeopro.com/user32804960/tradingview-indicators/video/115973132

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;

Code:
# 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 ;

up.SetDefaultColor(Color.UPTICK);
up.SetPaintingStrategy(PaintingStrategy.ARROW_UP);

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 ;

down.SetDefaultColor(Color.DownTICK);
down.SetPaintingStrategy(PaintingStrategy.ARROW_DOWN);
 
Last edited:

Top