Reversion Zone Index by Profitprotrading
Reversion Zone Index by Profitprotrading
Reversion Zone Index by Profitprotrading
0 at
https://mozilla.org/MPL/2.0/
// © profitprotrading
//@version=5
indicator(title='Reversion Zone Index', shorttitle='RZI', overlay=false, precision
= 0)
//CCI
lengthX = input.int(20, minval=1, group = "CCI")
srcX = input(hlc3, title="Source", group = "CCI")
maX = ta.sma(srcX, lengthX)
cci = (srcX - maX) / (0.015 * ta.dev(srcX, lengthX))
cci := cci/2
//BB%
length1 = input.int(20, minval=1)
src = input(close, title="Source", group = "BB Percentile")
mult = input.float(2.0, minval=0.001, maxval=50, title="StdDev", group = "BB
Percentile")
basis = ta.sma(src, length1)
dev = mult * ta.stdev(src, length1)
upper = basis + dev
lower = basis - dev
bbr = (src - lower)/(upper - lower)
bbr := bbr*80
//Plotting
col = color.from_gradient(combX, 7, 60, color.rgb(0, 200, 7), color.rgb(222, 0, 0))
up = 60
dn = 10
up1 = plot(up, "Overbought", color = color.rgb(255, 255, 255))
dn1 = plot(dn, "Oversold", color = color.white)
mid = plot(33.5, display = display.none)
combX1 = plot(combX, linewidth = 4, color = col, style = plot.style_line)
plotshape(comb2 < -10, style = shape.triangleup, color = color.rgb(0, 235, 8),
location = location.bottom, size = size.tiny)
plotshape(comb2 > 70, style = shape.triangledown, color = color.rgb(255, 0, 0),
location = location.top, size = size.tiny)