xmd79

Kidblex SNIPER

Sep 20th, 2021
305
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.23 KB | None | 0 0
  1. study(title="Kidblex SNIPER", shorttitle="Kidblex SNIPER", overlay=true)
  2. source = close
  3. length = input(56, minval=1, title = "WMA Length")
  4. atrlen = input(100, minval=1, title = "ATR Length")
  5. mult1 = 2
  6. mult2 = 3
  7. ma = wma(source, length)
  8. range = tr
  9. rangema = wma(range, atrlen)
  10.  
  11. up1 = ma + rangema * mult1
  12. up2 = ma + rangema * mult2
  13.  
  14. dn1 = ma - rangema * mult1
  15. dn2 = ma - rangema * mult2
  16.  
  17. color1 = black
  18. color2 = black
  19.  
  20. u4 = plot(up1, color = color1)
  21. u8 = plot(up2, color = color2)
  22.  
  23. d4 = plot(dn1, color = color1)
  24. d8 = plot(dn2, color = color2)
  25.  
  26. fill(u8, u4, color=#f44336, transp=80)
  27. fill(d8, d4, color=#2962ff, transp=80)
  28. fill(d4, u4, color=#131722, transp=80)
  29.  
  30. //Linear regression band
  31. src = close
  32. //Input
  33. nlookback = input (defval = 20, minval = 1, title = "Number of Lookback")
  34. scale = input(defval=1, title="scale of ATR")
  35. nATR = input(defval = 14, title="ATR Parameter")
  36.  
  37. //Center band
  38. periods=input(21, minval=1, title="MA Period")
  39. pc = input(true, title="MA BAND")
  40.  
  41. hld = iff(close > sma(high,periods)[1], 1, iff(close<sma(low,periods)[1],-1, 0))
  42. hlv = valuewhen(hld != 0, hld, 1)
  43.  
  44. hi = pc and hlv == -1 ? sma(high, periods) : na
  45. lo = pc and hlv == 1 ? sma(low,periods) : na
  46. plot(avg(sma(high,periods)+2.5*(sma(high,periods)-sma(low,periods)),sma(low,periods)-2.5*(sma(high,periods)-sma(low,periods))), color=red, style=line,linewidth=4)
  47.  
  48. //--------------------------------------------------------------------------------------------
  49. //=======================================================
  50. //Vdub_Tetris_V2
  51. LRG_Channel_TF_mins_D_W_M = input("30")
  52. Range2 = input(1)
  53.  
  54. SELL = security(tickerid, LRG_Channel_TF_mins_D_W_M, highest(Range2))
  55. BUY = security(tickerid, LRG_Channel_TF_mins_D_W_M, lowest(Range2))
  56.  
  57. HI = plot(SELL, color=SELL!=SELL[1]?na:red,linewidth=2 )
  58. LO = plot(BUY, color=BUY!=BUY[1]?na:green,linewidth=2 )
  59. fill(HI, LO, color=#E3CAF1, transp=100)
  60. Hcon = high >= SELL
  61. Lcon = low <= BUY
  62.  
  63. plotshape(Hcon, style=shape.arrowdown, color=red, location=location.abovebar)
  64. plotshape(Lcon, style=shape.arrowup, color=blue, location=location.belowbar)
  65. range2 = SELL-BUY
  66. //--------------------------------------------------
  67.  
  68. //=====================================================================//
  69.  
  70.  
Advertisement
Add Comment
Please, Sign In to add comment