Woodie CCI

study(title=“Trend and Entry CCI ST15”, shorttitle=“Trend and Entry CCI”)
CCI_Period = input(89, minval=1)
CCI_Period14 = input(21, minval=2)
T3_Period = input(5, minval=1)
b = input(0.618)
band5 = hline(100)
band4 = hline(-100)
hline(0, color=purple, linestyle=line)
band3 = hline(200, title=“Upper Line”, linestyle=dashed, linewidth=2, color=red)
band2 = hline(-200, title=“Lower Line”, linestyle=dashed, linewidth=2, color=lime)
band1 = hline(15)
band0 = hline(-15)
fill(band1, band0, color=yellow, transp=1)
xPrice = close
b2 = bb
b3 = b2
b
c1 = -b3
c2 = (3*(b2 + b3))
c3 = -3*(2b2 + b + b3)
c4 = (1 + 3
b + b3 + 3b2)
nn = iff(T3_Period < 1, 1, T3_Period)
nr = 1 + 0.5
(nn - 1)
w1 = 2 / (nr + 1)
w2 = 1 - w1
xcci = cci(xPrice, CCI_Period)
e1 = w1xcci + w2nz(e1[1])
e2 = w1e1 + w2nz(e2[1])
e3 = w1e2 + w2nz(e3[1])
e4 = w1e3 + w2nz(e4[1])
e5 = w1e4 + w2nz(e5[1])
e6 = w1e5 + w2nz(e6[1])
xccir = c1e6 + c2e5 + c3e4 + c4e3
cciHcolor = iff(xccir >= 0 , green,iff(xccir < 0, red, black))

xcci14 = cci(xPrice, CCI_Period14)
a1 = w1xcci14 + w2nz(a1[1])
a2 = w1a1 + w2nz(a2[1])
a3 = w1a2 + w2nz(a3[1])
a4 = w1a3 + w2nz(a4[1])
a5 = w1a4 + w2nz(a5[1])
a6 = w1a5 + w2nz(a6[1])
xccir14 = c1a6 + c2a5 + c3a4 + c4a3

plot(xccir, color=blue, title=“T3-CCI”)
plot(xccir, color=cciHcolor, title=“CCIH”, style = histogram)

plot(xccir14, color=orange, title=“CCIH”,linewidth=2, style = line)