Pine Script (TradingView)
Dies ist ein TradingView Pine-Script-Beispiel fur diesen Indikator. Fuge es im TradingView Pine Editor ein, lege es auf den Chart und passe die Eingaben fur Markt und Zeitrahmen an.
//@version=6
indicator("Commodity Channel Index (CCI)", overlay=false)
length = input.int(20, "CCI Length")
r = ta.cci(close, length)
longSignal = ta.crossover(r, -100)
shortSignal = ta.crossunder(r, 100)
plotshape(longSignal, style=shape.triangleup, location=location.bottom, color=color.green, size=size.small)
plotshape(shortSignal, style=shape.triangledown, location=location.top, color=color.red, size=size.small)
hline(100, "+100", color=color.red, linestyle=hline.style_dashed)
hline(0, "Zero", color=color.gray, linestyle=hline.style_dotted)
hline(-100, "-100", color=color.green, linestyle=hline.style_dashed)
plot(r, "CCI", color=color.new(color.purple, 0))