xmd79

Williams Vix Fix + Inverse [Alorse]

Sep 23rd, 2021
177
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.66 KB | None | 0 0
  1. //@version=4
  2. study("Williams Vix Fix + Inverse [Alorse]", shorttitle="WVF + Inverse [Alorse]", overlay=false)
  3.  
  4. // Bollinger Bands
  5. bbGroup = "Bollindger Bands"
  6. bbl = input(20, title="Length", group=bbGroup)
  7. mult = input(2.0, minval=1, maxval=5, title="Standard Deviation", group=bbGroup)
  8.  
  9. // Williams Vix Fix
  10. wvfGroup = "Williams Vix Fix"
  11. pd = input(20, title="LookBack Period StdDev", tooltip="LookBack Period Standard Deviation", group=wvfGroup)
  12. lb = input(50, title="LookBack Period Percentile", group=wvfGroup)
  13. ph = input(85, title="Highest Percentile", group=wvfGroup) * 0.01
  14. pl = input(99, title="Lowest Percentile", group=wvfGroup) * 0.01
  15.  
  16. wvf = ((highest(close, pd)-low)/(highest(close, pd)))*100
  17. sDev = mult * stdev(wvf, bbl)
  18. midLine = sma(wvf, bbl)
  19. upperBand = midLine + sDev
  20. rangeHigh = highest(wvf, lb) * ph
  21.  
  22. colNormal = wvf >= upperBand or wvf >= rangeHigh ? color.lime : color.new(color.silver, 20)
  23.  
  24. plot(wvf, title="Williams Vix Fix", style=plot.style_columns, color=colNormal)
  25. plot(upperBand, title="Normal StdDev line", style=plot.style_line, linewidth=1,color=color.blue)
  26.  
  27. plot(0, title="Cero line", color=color.white, style=plot.style_line)
  28.  
  29. wvfInv = ((high-lowest(close, pd))/lowest(close, pd))*100
  30. sDevInv = mult * stdev(wvfInv, bbl)
  31. midLineInv = sma(wvfInv, bbl)
  32. upperBandInv = midLineInv + sDevInv
  33. rangeHighInv = lowest(wvfInv, lb) * pl
  34.  
  35. colInv = wvfInv <= upperBandInv or wvfInv <= rangeHighInv ? color.new(color.silver, 20) : color.orange
  36.  
  37. plot(wvfInv*-1, title="Williams Vix Fix Inverted", style=plot.style_columns, color=colInv)
  38. plot(upperBandInv*-1, title="Inverted StdDev line", style=plot.style_line, linewidth=1,color=color.blue)
Advertisement
Add Comment
Please, Sign In to add comment