0% found this document useful (0 votes)
119 views3 pages

Double Sided Vix Fix

This document contains the code for a technical analysis indicator called the Double Sided Vix Fix. The code defines inputs to customize the indicator parameters and alerts. It then calculates the Williams Vix Fix values and defines criteria to generate alerts and highlight bars on the chart.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
119 views3 pages

Double Sided Vix Fix

This document contains the code for a technical analysis indicator called the Double Sided Vix Fix. The code defines inputs to customize the indicator parameters and alerts. It then calculates the Williams Vix Fix values and defines criteria to generate alerts and highlight bars on the chart.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 3

//!!!!!!!!!!!!! check lines 40-43 and manually change to the ticker you use.

study(title="Double_Sided_Vix_Fix", shorttitle="Double_Sided_Vix_Fix",
overlay=false)
//Created By ChrisMoody on 12-26-2014...V3 MAJOR Update on 1-05-2014
//01-05-2014 Major Updates Include:
//FILTERED ENTRIES --- AND AGGRESSIVE FILTERED ENTRIES - HIGHLIGHT BARS AND ALERTS
//Ability to Change All Bars To Gray, and Plot Entries AND Highlight Bars That
Match The Williams Vix Fix
//Alerts Enabled for 4 Different Criteria
//Ability To Plot Alerts True/False Conditions on top of the WVF Histogram
//Or Get Rid Of the Histogram and just see True/False Alerts Conditions.

//Inputs Tab Criteria.


pd = input(22, title="LookBack Period Standard Deviation High")
bbl = input(20, title="Bolinger Band Length")
mult = input(2.0 , minval=1, maxval=5, title="Bollinger Band Standard Devaition
Up")
lb = input(50 , title="Look Back Period Percentile High")
ph = input(.85, title="Highest Percentile - 0.90=90%, 0.95=95%, 0.99=99%")
new = input(false, title="-------Highlight Bars Below Use Original Criteria-------"
)
sbc = input(true, title="Show Highlight Bar if WVF WAS True and IS Now False")
sbcc = input(false, title="Show Highlight Bar if WVF IS True")
new2 = input(false, title="-------Highlight Bars Below Use FILTERED
Criteria-------" )
sbcFilt = input(true, title="Show Highlight Bar For Filtered Entry")
sbcAggr = input(false, title="Show Highlight Bar For AGGRESSIVE Filtered Entry")
new3 = input(false, title="Check Below to turn All Bars Gray, Then Check the Boxes
Above, And your will have Same Colors As VixFix")
sgb = input(false, title="Check Box To Turn Bars Gray?")
//Criteria for Down Trend Definition for Filtered Pivots and Aggressive Filtered
Pivots
ltLB = input(40, minval=25, maxval=99, title="Long-Term Look Back Current Bar Has
To Close Below This Value OR Medium Term--Default=40")
mtLB = input(14, minval=10, maxval=20, title="Medium-Term Look Back Current Bar Has
To Close Below This Value OR Long Term--Default=14")
str = input(3, minval=1, maxval=9, title="Entry Price Action Strength--Close > X
Bars Back---Default=3")
//Alerts Instructions and Options Below...Inputs Tab
new4 = input(false, title="-------------------------Turn On/Off ALERTS
Below---------------------" )
new5 = input(false, title="----To Activate Alerts You HAVE To Check The Boxes Below
For Any Alert Criteria You Want----")
new6 = input(false, title="----You Can Un Check The Box BELOW To Turn Off the WVF
Histogram And Just See True/False Alert Criteria----")
swvf = input(true, title="Show Williams Vix Fix Histogram, Uncheck to Turn Off!")
sa1 = input(false, title="Show Alert WVF = True?")
sa2 = input(false, title="Show Alert WVF Was True Now False?")
sa3 = input(false, title="Show Alert WVF Filtered?")
sa4 = input(false, title="Show Alert WVF AGGRESSIVE Filter?")

close_i=security("1/EURUSD", period, close)


open_i=security("1/EURUSD", period, open)
low_i=security("1/EURUSD", period, low)
high_i=security("1/EURUSD", period, high)

//Williams Vix Fix Formula


wvf_i = ((highest(close_i, pd)-low_i)/(highest(close_i, pd)))*100
sDev_i = mult * stdev(wvf_i, bbl)
midLine_i = sma(wvf_i, bbl)
lowerBand_i = midLine_i - sDev_i
upperBand_i = midLine_i + sDev_i
rangeHigh_i = (highest(wvf_i, lb)) * ph

plot(wvf_i, title='wvf_i')
plot(lowerBand_i, title='lowerBand_i', color=blue)
plot(upperBand_i, title='upperBand_i', color=blue)

//Filtered Bar Criteria


upRange_i = low_i > low_i[1] and close_i > high_i[1]
upRange_Aggr_i = close_i > close_i[1] and close_i > open_i[1]
//Filtered Criteria
filtered_i = ((wvf_i[1] >= upperBand_i[1] or wvf_i[1] >= rangeHigh_i[1]) and (wvf_i
< upperBand_i and wvf_i < rangeHigh_i))
filtered_Aggr_i = (wvf[1] >= upperBand_i[1] or wvf_i[1] >= rangeHigh_i[1]) and not
(wvf_i < upperBand_i and wvf_i < rangeHigh_i)

//Alerts Criteria
alert1_i = wvf_i >= upperBand_i or wvf_i >= rangeHigh_i ? 0.5 : 0
alert2_i = (wvf_i[1] >= upperBand_i[1] or wvf_i[1] >= rangeHigh_i[1]) and (wvf_i <
upperBand_i and wvf_i < rangeHigh_i) ? 0.5 : 0
alert3_i = upRange_i and close_i > close_i[str] and (close_i < close_i[ltLB] or
close_i < close_i[mtLB]) and filtered_i ? 0.5 : 0
alert4_i = upRange_Aggr_i and close_i > close_i[str] and (close_i < close_i[ltLB]
or close_i < close_i[mtLB]) and filtered_Aggr_i ? 0.5 : 0

//Highlight Bar Criteria


barcolor(sbcAggr and alert4_i ? orange : na)
barcolor(sbcFilt and alert3_i ? fuchsia : na)
barcolor(sbc and ((wvf_i[1] >= upperBand_i[1] or wvf_i[1] >= rangeHigh_i[1]) and
(wvf_i < upperBand_i and wvf_i < rangeHigh_i)) ? aqua : na)
barcolor(sbcc and (wvf_i >= upperBand_i or wvf_i >= rangeHigh_i) ? lime : na)
barcolor(sgb and close_i ? gray : na)

//Coloring Criteria of Williams Vix Fix


col_i = wvf_i >= upperBand_i ? lime : gray // or wvf >= rangeHigh

//Plots for Williams Vix Fix Histogram and Alerts


plot(swvf and wvf_i ? wvf_i : na, title="Williams Vix Fix", style=columns,
linewidth = 4, color=col_i)
plot(sa1 and alert1_i ? alert1_i : 0, title="Alert If WVF = True", style=line,
linewidth=2, color=lime)
plot(sa2 and alert2_i ? alert2_i : 0, title="Alert If WVF Was True Now False",
style=line, linewidth=2, color=aqua)
plot(sa3 and alert3_i ? alert3_i : 0, title="Alert Filtered Entry", style=line,
linewidth=2, color=fuchsia)
plot(sa4 and alert4_i ? alert4_i : 0, title="Alert Aggressive Filtered Entry",
style=line, linewidth=2, color=orange)

//--- BOTTOMS (regular VixFix formula)


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

plot(wvf*-1, title='wvf')
plot(lowerBand*-1, title='lowerBand', color=fuchsia)
plot(upperBand*-1, title='upperBand', color=fuchsia)

//Filtered Bar Criteria


upRange = low > low[1] and close > high[1]
upRange_Aggr = close > close[1] and close > open[1]
//Filtered Criteria
filtered = ((wvf[1] >= upperBand[1] or wvf[1] >= rangeHigh[1]) and (wvf < upperBand
and wvf < rangeHigh))
filtered_Aggr = (wvf[1] >= upperBand[1] or wvf[1] >= rangeHigh[1]) and not (wvf <
upperBand and wvf < rangeHigh)

//Alerts Criteria
alert1 = wvf >= upperBand or wvf >= rangeHigh ? -0.5 : 0
alert2 = (wvf[1] >= upperBand[1] or wvf[1] >= rangeHigh[1]) and (wvf < upperBand
and wvf < rangeHigh) ? -0.5 : 0
alert3 = upRange and close > close[str] and (close < close[ltLB] or close <
close[mtLB]) and filtered ? -0.5 : 0
alert4 = upRange_Aggr and close > close[str] and (close < close[ltLB] or close <
close[mtLB]) and filtered_Aggr ? -0.5 : 0

//Highlight Bar Criteria


barcolor(sbcAggr and alert4 ? orange : na)
barcolor(sbcFilt and alert3 ? fuchsia : na)
barcolor(sbc and ((wvf[1] >= upperBand[1] or wvf[1] >= rangeHigh[1]) and (wvf <
upperBand and wvf < rangeHigh)) ? aqua : na)
barcolor(sbcc and (wvf >= upperBand or wvf >= rangeHigh) ? lime : na)
barcolor(sgb and close ? gray : na)

//Coloring Criteria of Williams Vix Fix


col = wvf >= upperBand ? red : gray // or wvf >= rangeHigh

//Plots for Williams Vix Fix Histogram and Alerts


plot(swvf and wvf ? wvf * -1 : na, title="Williams Vix Fix", style=columns,
linewidth = 4, color=col)
plot(sa1 and alert1 ? alert1 : 0, title="Alert If WVF = True", style=line,
linewidth=2, color=lime)
plot(sa2 and alert2 ? alert2 : 0, title="Alert If WVF Was True Now False",
style=line, linewidth=2, color=aqua)
plot(sa3 and alert3 ? alert3 : 0, title="Alert Filtered Entry", style=line,
linewidth=2, color=fuchsia)
plot(sa4 and alert4 ? alert4 : 0, title="Alert Aggressive Filtered Entry",
style=line, linewidth=2, color=orange)

You might also like