cci
Commodity Channel Index
cci(period)
Parameters
| Name | Type | Description |
|---|---|---|
period |
int | Number of periods for calculation |
Formula
CCI = (typical_price - SMA(typical_price, period)) / (0.015 * mean_deviation)
Examples
cci(20); # Standard 20-period CCI
cci(14); # 14-period CCI (more sensitive)
cci(20) > 100; # Overbought condition
cci(20) < -100; # Oversold condition
Returns
float
Range
period must be 2-400
Notes
The CASE falls back to 0.0 when mean_deviation is 0 or NULL, so CCI never resolves to NULL
See Also
References
TradingView: ta.cci(); developed by Donald Lambert