# Commodity channel index

`cci`

Distance from the average in units of mean deviation.

## Inputs

| Name | Type | Default | Range |
| --- | --- | --- | --- |
| source | source | hlc3 |  |
| period | int | 14 | 1 to 5000 |

## Outputs

| Name | Kind |
| --- | --- |
| cci | value |

Warm-up: period - 1 bars (13 at the defaults).

Repaints: No.

## Formula

The typical price by default

CCI = (x - SMA) / (0.015 * mean absolute deviation) over the last period values

No deviation reads 0.
