ta.cci() - Pine Script Function
ta.cci()
Section titled “ta.cci()”Overview
Section titled “Overview”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.
Syntax
Section titled “Syntax”ta.cci(source, length) → series floatParameters
Section titled “Parameters”| Name | Type | Description |
|---|---|---|
| source | series int/float | Series of values to process. |
Returns
Section titled “Returns”Commodity channel index of source for length bars back.
Remarks
Section titled “Remarks”- na values in the source series are ignored.