ChrisMoody

CM_Enhanced CCI V2

Added 0 Line, + - 200 lines

Added a line that hi-lights the outside of the CCI

Updated 8/12/2014 by request for christian.david.75457

Added Ability To Plot 2nd CCI - !!!

Added ability to turn On/Off the +-200 lines.

Added Ability to Turn On/Off Show Area of CCI

Added Ability To Turn On/Off Show The Outer CCI Line

Script de código aberto

Dentro do verdadeiro espírito TradingView, o autor deste script publicou ele como um script de código aberto, para que os traders possam compreender e checar ele. Um viva ao autor! Você pode usá-lo gratuitamente, mas a reutilização deste código em uma publicação é regida pelas Regras da Casa. Você pode favoritá-lo para usá-lo em um gráfico.

Aviso legal

As informações e publicações não devem ser e não constituem conselhos ou recomendações financeiras, de investimento, de negociação ou de qualquer outro tipo, fornecidas ou endossadas pela TradingView. Leia mais em Termos de uso.

Quer usar esse script no gráfico?
//created by user ChrisMoody 2-2-2014
//Added 0 Line, +-200 lines, a line that hilights the outside of the CCI
//Updated 8/12/2014 by request for christian.david.75457
//Added Ability To Plot 2nd CCI
//Added ability to turn On/Off the +-200 lines.
//Added Ability to Turn On/Off Show Area of CCI and ability To Turn On/Off Show The Outer CCI Line
study(title="CM_Enhanced CCI V2", shorttitle="CM_Enhanced CCI V2", precision=0)
source = close
length = input(30, minval=1, title="Main CCI Length")
sol = input(true, title="Show Outer CCI Line")
shCCI2 = input(true, title="Show 2nd CCI?")
shHist = input(true, title="Show CCI Histogram?")
length2 = input(14, minval=1, title="2nd CCI Length")
sh200 = input(true, title="Show +200 and -200 Lines?")
//CCI 1
ma = sma(source, length)
cci = (source - ma) / (0.015 * dev(source, length))
maCCI1 = sma(cci, 1)
//CCI 2
ma2 = sma(source, length2)
cci2 = shCCI2 and (source - ma2) / (0.015 * dev(source, length2)) ? (source - ma2) / (0.015 * dev(source, length2)) : na
maCCI2 = shCCI2 and sma(cci2, 1) ? sma(cci2, 1) : na

plot(shHist and cci ? cci : na, title='CCI', color=green, style=areabr, linewidth=3, transp=20)
plot(sol and maCCI1 ? maCCI1 : na, title='OuterCCI Highlight', color=lime, style=line, linewidth=4)

plot(shHist and cci2 ? cci2 : na, title='CCI 2nd Line', color=red, style=columns, transp=60)
plot(sol and maCCI2 ? maCCI2 : na, title='OuterCCI Highlight 2nd Line', color=red, style=line, linewidth=3)

band1 = hline(100, title='100 Line',color=white, linestyle=dashed, linewidth=3)
band0 = hline(-100, title='-100 Line', color=white, linestyle=dashed, linewidth=3)
fill(band1, band0, color=white, transp=70)

plot(sh200 and 200 ? 200 : na, title="200 Line",color=red, style=line, linewidth=3)
plot(sh200 and -200 ? -200 : na, title='-200 Line', color=lime, style=line, linewidth=3)
hline(0, title='0 Line', color=white, linestyle=solid, linewidth=2)