xmd79

[blackcat] L1 Fibonacci VWAP RSI Indicator

Oct 5th, 2021
283
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.86 KB | None | 0 0
  1. // ____ __ ___ ________ ___________ ___________ __ ____ ___
  2. // / __ )/ / / | / ____/ //_/ ____/ |/_ __< / // / / __ |__ \
  3. // / __ / / / /| |/ / / ,< / / / /| | / / / / // /_/ / / __/ /
  4. // / /_/ / /___/ ___ / /___/ /| / /___/ ___ |/ / / /__ __/ /_/ / __/
  5. // /_____/_____/_/ |_\____/_/ |_\____/_/ |_/_/ /_/ /_/ \____/____/
  6.  
  7. // This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
  8. // © blackcat1402
  9. //@version=4
  10.  
  11. study("[blackcat] L1 Fibonacci VWAP RSI Indicator", overlay=false, max_bars_back=5000, max_labels_count=500)
  12.  
  13. //inputs
  14. LookbackLength = input(400, title = "LookbackLength")
  15. RSILength = input(14, title = "RSILength")
  16. Fib1 = input(23.6, title = "Fib1")
  17. Fib2 = input(31.1, title = "Fib2")
  18. Fib3 = input(100, title = "Fib3")
  19.  
  20. //vars
  21. RawVWAPRSI = 0.00
  22. RangeHigh = 0.00
  23. RangeLow = 100.00
  24. ChartRange = 0.00
  25. Trendline1 = 0.00
  26. Trendline2 = 0.00
  27. Trendline3 = 0.00
  28.  
  29. inp = input(hl2)
  30.  
  31.  
  32. RawVWAPRSI := rsi(vwap(inp), RSILength )
  33. if bar_index > LookbackLength
  34. RangeHigh := highest(RawVWAPRSI,LookbackLength )
  35. RangeLow := lowest(RawVWAPRSI, LookbackLength )
  36. ChartRange := RangeHigh - RangeLow
  37. Trendline1 := Fib1/100*ChartRange + RangeLow
  38. Trendline2 := Fib2/100*ChartRange + RangeLow
  39. Trendline3 := Fib3/100*ChartRange + RangeLow
  40.  
  41. Plot1 =plot( bar_index > LookbackLength ? RawVWAPRSI : na , color= RawVWAPRSI > RawVWAPRSI[1] ? color.yellow : color.fuchsia, linewidth = 2)
  42.  
  43. Plot2 = plot( bar_index > LookbackLength ? RangeLow + ChartRange / 2 : na, color=color.white )
  44. Plot3 = plot( bar_index > LookbackLength ? Trendline1 : na, color=color.green )
  45. Plot4 = plot( bar_index > LookbackLength ? Trendline2 : na, color=color.blue )
  46. Plot5 = plot( bar_index > LookbackLength ? Trendline3 : na, color=color.red )
  47.  
Advertisement
Add Comment
Please, Sign In to add comment