Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- study(title = "TheLark Laguerre RSI",overlay=false)
- //•/•/•/•/•/•/•/•/•/•/•/•/•/•/•/•/•/•/•/•/•/•/•//
- // //
- // LAGUERRE RSI BY THELARK //
- // ~ 2-17-14 ~ //
- // //
- // •/• //
- // //
- // https://www.tradingview.com/u/TheLark //
- // //
- //•/•/•/•/•/•/•/•/•/•/•/•/•/•/•/•/•/•/•/•/•/•/•//
- // Averages, and the way they are compared and calculated make up a large amount
- // of the indicators out there, so the fun thing about new averages, is how they
- // open up a whole new group of indicators.
- // This is Laguerre RSI. You'll notice it acts a little different than your normal RSI,
- // and it can be traded in different ways. It can be used as a switch, or to view bursts
- // of momentum. Combine with your style and see if you notice anything. It might just
- // be what you were looking for! Stay tuned for more scripts & ideas by following me on TradingView.
- //setups
- h = high
- l = low
- c = close
- //inputs
- g = input(0.75, title="Gamma")
- ob = input(0.80,title="Over Bought")
- os = input(0.20,title="Over Sold")
- smooth = input(1,minval=1,title="Smoothing (1 = off)")
- coloring = input(true,type=bool,title="3 colors?")
- //calc
- p = c
- L0 = ((1 - g)*p)+(g*nz(L0[1]))
- L1 = (-g*L0)+nz(L0[1])+(g*nz(L1[1]))
- L2 = (-g*L1)+nz(L1[1])+(g*nz(L2[1]))
- L3 = (-g*L2)+nz(L2[1])+(g*nz(L3[1]))
- cu = (L0>L1?L0-L1:0)+(L1>L2?L1-L2:0)+(L2>L3?L2-L3:0)
- cd = (L0<L1?L1-L0:0)+(L1<L2?L2-L1:0)+(L2<L3?L3-L2:0)
- //plots
- lrsi=ema((cu+cd==0?-1:cu+cd)==-1?0:(cu/(cu+cd==0?-1:cu+cd)), smooth)
- hline(ob)
- hline(os)
- col1 = lrsi > lrsi[1] and lrsi > os ? #00FF7B : lrsi < lrsi[1] and lrsi < ob ? #FF3571 : lrsi == lrsi ? #ECA700 : #ECA700
- col2 = lrsi > lrsi[1] and lrsi > os ? #00FF7B : lrsi < lrsi[1] and lrsi < ob ? #FF3571 : lrsi < os ? #FF3571 : lrsi > ob ? #00FF7B : lrsi == lrsi ? #ECA700 : #ECA700
- col = coloring ? col1 : col2
- plot(lrsi, color=col, linewidth=2,style=line)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement