Jaguar
Jaguar
study(title="Jaguar", overlay=true)
src=close
smoothrng(x, t, m)=>
wper = (t*2) - 1
smoothrng
rngfilt(x, r)=>
rngfilt = x
rngfilt := x > nz(rngfilt[1]) ? ((x - r) < nz(rngfilt[1]) ? nz(rngfilt[1]) : (x - r)) : ((x + r) > nz(rngfilt[1]) ?
nz(rngfilt[1]) : (x + r))
rngfilt
upward = 0.0
downward = 0.0
barcolor = (src > filt) and (src > src[1]) and (upward > 0) ? lime : (src > filt) and (src < src[1]) and (upward
> 0) ? gray :
(src < filt) and (src < src[1]) and (downward > 0) ? red : (src < filt) and (src > src[1]) and (downward >
0) ? gray : gray
barcolor(barcolor)
longCond = na
shortCond = na
longCond := ((src > filt) and (src > src[1]) and (upward > 0)) or ((src > filt) and (src < src[1]) and (upward >
0))
shortCond := ((src < filt) and (src < src[1]) and (downward > 0)) or ((src < filt) and (src > src[1]) and
(downward > 0))
CondIni = 0
plotshape(longCondition, title = "Buy Signal", text ="BUY", textcolor = white, style=shape.labelup, size =
size.normal, location=location.belowbar, color = green, transp = 0)