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

Skript med en öppen källkod

I sann TradingView-anda har författaren publicerat detta skript med öppen källkod så att andra handlare kan förstå och verifiera det. Hatten av för författaren! Du kan använda det gratis men återanvändning av den här koden i en publikation regleras av våra ordningsregler. Du kan ange den som favorit för att använda den i ett diagram.

Frånsägelse av ansvar

Informationen och publikationerna är inte avsedda att vara, och utgör inte heller finansiella, investerings-, handels- eller andra typer av råd eller rekommendationer som tillhandahålls eller stöds av TradingView. Läs mer i Användarvillkoren.

Vill du använda det här skriptet i ett diagram?
//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)