Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- study(title="Kidblex SNIPER", shorttitle="Kidblex SNIPER", overlay=true)
- source = close
- length = input(56, minval=1, title = "WMA Length")
- atrlen = input(100, minval=1, title = "ATR Length")
- mult1 = 2
- mult2 = 3
- ma = wma(source, length)
- range = tr
- rangema = wma(range, atrlen)
- up1 = ma + rangema * mult1
- up2 = ma + rangema * mult2
- dn1 = ma - rangema * mult1
- dn2 = ma - rangema * mult2
- color1 = black
- color2 = black
- u4 = plot(up1, color = color1)
- u8 = plot(up2, color = color2)
- d4 = plot(dn1, color = color1)
- d8 = plot(dn2, color = color2)
- fill(u8, u4, color=#f44336, transp=80)
- fill(d8, d4, color=#2962ff, transp=80)
- fill(d4, u4, color=#131722, transp=80)
- //Linear regression band
- src = close
- //Input
- nlookback = input (defval = 20, minval = 1, title = "Number of Lookback")
- scale = input(defval=1, title="scale of ATR")
- nATR = input(defval = 14, title="ATR Parameter")
- //Center band
- periods=input(21, minval=1, title="MA Period")
- pc = input(true, title="MA BAND")
- hld = iff(close > sma(high,periods)[1], 1, iff(close<sma(low,periods)[1],-1, 0))
- hlv = valuewhen(hld != 0, hld, 1)
- hi = pc and hlv == -1 ? sma(high, periods) : na
- lo = pc and hlv == 1 ? sma(low,periods) : na
- 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)
- //--------------------------------------------------------------------------------------------
- //=======================================================
- //Vdub_Tetris_V2
- LRG_Channel_TF_mins_D_W_M = input("30")
- Range2 = input(1)
- SELL = security(tickerid, LRG_Channel_TF_mins_D_W_M, highest(Range2))
- BUY = security(tickerid, LRG_Channel_TF_mins_D_W_M, lowest(Range2))
- HI = plot(SELL, color=SELL!=SELL[1]?na:red,linewidth=2 )
- LO = plot(BUY, color=BUY!=BUY[1]?na:green,linewidth=2 )
- fill(HI, LO, color=#E3CAF1, transp=100)
- Hcon = high >= SELL
- Lcon = low <= BUY
- plotshape(Hcon, style=shape.arrowdown, color=red, location=location.abovebar)
- plotshape(Lcon, style=shape.arrowup, color=blue, location=location.belowbar)
- range2 = SELL-BUY
- //--------------------------------------------------
- //=====================================================================//
Advertisement
Add Comment
Please, Sign In to add comment