Advertisement
Guest User

Untitled

a guest
Feb 21st, 2019
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.37 KB | None | 0 0
  1. //@version=3
  2. //The files in this repository are created by me and provided under the MIT License
  3. //located at https://github.com/yield65/tradingview/blob/master/LICENSE
  4. //If you find them useful please consider making a donation, thank you.
  5. //Bitcoin: 3F636VrPCdnbfrdP5kS4C6fHWVBffXNKCu
  6. //Litecoin: 33932ckE7i3oAQZxxSgLcvmbn8RAgTc2tk
  7. //ETH: 0x53A43EF9E56908A9c868FBf2f1b9DE7B3486FDAF
  8. //contact: bucket@mailbox.org
  9.  
  10. study("Chad Pepe Ribbon", precision=0, overlay=true)
  11.  
  12. lw1 = input(1, step=1, maxval=4, minval=1, title="Width 1st Group")
  13. lw2 = input(1, step=1, maxval=4, minval=1, title="Width 2nd Group")
  14. lw3 = input(1, step=1, maxval=4, minval=1, title="Width 3rd Group")
  15. showlw1 = input(true, title="Show 1st Group?")
  16. showlw2 = input(true, title="Show 2nd Group?")
  17. showlw3 = input(true, title="Show 3rd Group?")
  18. trp = input(30, step=5, minval=0, maxval=100, title="Transparency")
  19. paintbg = input(false, title="Paint background?")
  20. showvwap = input(false, title="Show VWAP?")
  21. showflips = input(false, title="Show flips??")
  22. src = close
  23. offset = 0.75
  24. sigma = 4
  25.  
  26.  
  27. //fast term ribbon 3, 5, 8, 10, 12, and 18
  28. ftrb1 = alma(src, 3, offset, sigma)
  29. ftrb2 = alma(src, 5, offset, sigma)
  30. ftrb3 = alma(src, 8, offset, sigma)
  31. ftrb4 = alma(src, 10, offset, sigma)
  32. ftrb5 = alma(src, 12, offset, sigma)
  33. ftrb6 = alma(src, 18, offset, sigma)
  34.  
  35. //slow term ribbon 30, 35, 40, 45, 50, and 60
  36. strb1 = alma(src, 30, offset, sigma)
  37. strb2 = alma(src, 35, offset, sigma)
  38. strb3 = alma(src, 40, offset, sigma)
  39. strb4 = alma(src, 45, offset, sigma)
  40. strb5 = alma(src, 50, offset, sigma)
  41. strb6 = alma(src, 60, offset, sigma)
  42.  
  43. //long supports 132, 198, 264, 330, 396, 462
  44. ltrb1 = alma(src, 132, offset, sigma)
  45. ltrb2 = alma(src, 198, offset, sigma)
  46. ltrb3 = alma(src, 264, offset, sigma)
  47. ltrb4 = alma(src, 330, offset, sigma)
  48. ltrb5 = alma(src, 396, offset, sigma)
  49. ltrb6 = alma(src, 462, offset, sigma)
  50.  
  51. fbullish = ftrb1 > ftrb2 and ftrb2 > ftrb3 and ftrb3 > ftrb4 and ftrb4 > ftrb5 and ftrb5 > ftrb6 and ftrb6 > strb1 and strb1 > strb2 and strb2 > strb3 and strb3 > strb4 and strb4 > strb5 and strb5 > strb6
  52. fbearish = ftrb1 < ftrb2 and ftrb2 < ftrb3 and ftrb3 < ftrb4 and ftrb4 < ftrb5 and ftrb5 < ftrb6 and ftrb6 < strb1 and strb1 < strb2 and strb2 < strb3 and strb3 < strb4 and strb4 < strb5 and strb5 < strb6
  53.  
  54. crossing_u = close > ftrb1 and close > ftrb2 and close > ftrb3 and close > ftrb4 and close > ftrb5 and close > ftrb6 and close > strb1 and close > strb2 and close > strb3 and close > strb4 and close > strb5 and close > strb6
  55. crossing_d = close < ftrb1 and close < ftrb2 and close < ftrb3 and close < ftrb4 and close < ftrb5 and close < ftrb6 and close < strb1 and close < strb2 and close < strb3 and close < strb4 and close < strb5 and close < strb6
  56.  
  57. flipalert = crossing_u or crossing_d
  58. alertcondition(flipalert, title='Flip alert', message='Trend flipped entirely!')
  59.  
  60. bgcolor(fbullish and paintbg ? white : fbearish and paintbg ? orange : na, transp = 70 )
  61. plot(showlw1 ? ftrb1 : na, title='ALMA 03', color=#0000FF, style=line, linewidth=lw1, transp=trp, editable=false)
  62. plot(showlw1 ? ftrb2 : na, title='ALMA 05', color=#0033FF, style=line, linewidth=lw1, transp=trp, editable=false)
  63. plot(showlw1 ? ftrb3 : na, title='ALMA 08', color=#0065FF, style=line, linewidth=lw1, transp=trp, editable=false)
  64. plot(showlw1 ? ftrb4 : na, title='ALMA 10', color=#0099FF, style=line, linewidth=lw1, transp=trp, editable=false)
  65. plot(showlw1 ? ftrb5 : na, title='ALMA 12', color=#00CBFF, style=line, linewidth=lw1, transp=trp, editable=false)
  66. plot(showlw1 ? ftrb6 : na, title='ALMA 18', color=#00FFFF, style=line, linewidth=lw1, transp=trp, editable=false)
  67.  
  68. plot(showlw2 ? strb1 : na, title='ALMA 30', color=#9800FF, style=line, linewidth=lw2, transp=trp, editable=false)
  69. plot(showlw2 ? strb2 : na, title='ALMA 35', color=#AD33FF, style=line, linewidth=lw2, transp=trp, editable=false)
  70. plot(showlw2 ? strb3 : na, title='ALMA 40', color=#BD5CFF, style=line, linewidth=lw2, transp=trp, editable=false)
  71. plot(showlw2 ? strb4 : na, title='ALMA 45', color=#CA7DFF, style=line, linewidth=lw2, transp=trp, editable=false)
  72. plot(showlw2 ? strb5 : na, title='ALMA 50', color=#D597FF, style=line, linewidth=lw2, transp=trp, editable=false)
  73. plot(showlw2 ? strb6 : na, title='ALMA 60', color=#DDACFF, style=line, linewidth=lw2, transp=trp, editable=false)
  74.  
  75. plot(showlw3 ? ltrb1 : na, title='ALMA 132', color=#FFA400, style=line, linewidth=lw3, transp=trp, editable=false)
  76. plot(showlw3 ? ltrb2 : na, title='ALMA 198', color=#E57600, style=line, linewidth=lw3, transp=trp, editable=false)
  77. plot(showlw3 ? ltrb3 : na, title='ALMA 264', color=#CC4F00, style=line, linewidth=lw3, transp=trp, editable=false)
  78. plot(showlw3 ? ltrb4 : na, title='ALMA 330', color=#B22E00, style=line, linewidth=lw3, transp=trp, editable=false)
  79. plot(showlw3 ? ltrb5 : na, title='ALMA 396', color=#991300, style=line, linewidth=lw3, transp=trp, editable=false)
  80. plot(showlw3 ? ltrb6 : na, title='ALMA 462', color=#800000, style=line, linewidth=lw3, transp=trp, editable=false)
  81.  
  82. plot(showvwap and isintraday ? vwap(close) : na, color=yellow, linewidth=2, transp=0, title="VWAP")
  83.  
  84. plotshape(showflips ? crossing_u : na, title="Dot mark Up", style=shape.circle, location=location.top, color=green, transp=0, size=size.tiny, editable=false)
  85. plotshape(showflips ? crossing_d : na, title="Dot mark Down", style=shape.circle, location=location.top, color=red, transp=0, size=size.tiny, editable=false)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement