Commodity channel index
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 | Type | Required | Description |
|---|---|---|---|
| cci | value | Optional | color theme.accent, style line, width 1 |
- Warm-up
- period - 1 bars (13 at the defaults)
- Repaints
- No
- Parity
- TA-Lib, within 1e-9
Formula
The typical price by default
CCI = (x - SMA) / (0.015 * mean absolute deviation) over the last period values
No deviation reads 0.