Skip to content
Algo Trade Analytics Docs

ta.cci() - Pine Script Function

The CCI (commodity channel index) is calculated as the difference between the typical price of a commodity and its simple moving average, divided by the mean absolute deviation of the typical price. The index is scaled by an inverse factor of 0.015 to provide more readable numbers.

ta.cci(source, length) → series float
NameTypeDescription
sourceseries int/floatSeries of values to process.

Commodity channel index of source for length bars back.

  • na values in the source series are ignored.