indicator · own pane · open source

Commodity Channel Index indicator

Commodity Channel Index is a free open-source indicator by @deepwick. Commodity Channel Index (CCI) measures how far the typical price has wandered from its… Deepwick Script runs a subset of Pine Script.

Deepwick · @deepwickv1Updated 3 Nov 2026▲ 0 users
Running…
Loading chart…

What Commodity Channel Index does

Commodity Channel Index (CCI) measures how far the typical price has wandered from its moving average in units of mean deviation.

  • Above +100 = strong bullish momentum, below -100 = strong bearish.
  • Zero-line crossings are momentum shifts.
  • Raise Length to suppress noise in chop.

Source code

Deepwick Script, a subset of Pine Script · read-only

//@version=6
indicator("Commodity Channel Index", overlay=false)
len = input.int(20, "Length", minval=2, maxval=200)
src = input.source(close, "Source")
colorMid2 = input.color("color.teal", "Color  Mid2")
colorNeutral = input.color("color.gray", "Color  Neutral")
cci = ta.cci(src, len)
hline(100, "Overbought", color=colorNeutral, linestyle=hline.style_dashed)
hline(-100, "Oversold", color=colorNeutral, linestyle=hline.style_dashed)
hline(0, "Zero", color=colorNeutral, linestyle=hline.style_dotted)
p_CCI = plot(cci, "CCI", color=colorMid2, linewidth=2)
alertcondition(ta.crossover(cci, 100), "CCI overbought", "CCI crossed above +100")
alertcondition(ta.crossunder(cci, -100), "CCI oversold", "CCI crossed below -100")

Comments

No comments yet.

Sign in to comment.