```
study(title="CCIEMA", shorttitle="CCI+EMA by perrito Blacky")
length1 = input(20, minval=1, title="CCI")
ma_length = input(13, minval=1, title="EMA")
src = input(close, title="Source")
ma1 = sma(src, length1)
cci1 = (src - ma1) / (0.015 * dev(src, length1))
//plot(cci1, color=blue, linewidth=2)
plot(cci1, linewidth=2)
//plot(ema(cci1, ma_length), color=green, linewidth=2)
plot(ema(cci1, ma_length), linewidth=2)
plotColour = (cci1 > ema(cci1, ma_length)) ? green : red
plotCCIEMA = plot(series=cci1, color=plotColour, linewidth=2)
//plotHoriz = plot(series=0, color=blue, style=circles)
//fill(plot1=plotCCIEMA, plot2=plotHoriz, color=blue, transp=90)
band0 = hline(200, color=red)
band1 = hline(100, color=blue)
band2 = hline(0,title="zero")
band3 = hline(-100, color=blue)
band4 = hline(-200, color=red)
fill(band1, band3, color=blue, transp=95)
```