Momentum indicators

Commodity Channel Index

Unbounded oscillator measuring typical-price deviation from its recent mean.

Engine
TA-Lib
Function
CCI
Input series
high, low, close
Outputs
1

How it works

CCI calculates typical price from high, low, and close, compares it with the simple average of typical price, and scales the difference by mean absolute deviation and the constant 0.015.

Use case

Use CCI as a momentum and price-deviation feature for identifying unusually strong moves, trend changes, and relative extremes.

Parameters

ParameterTypeDefaultBounds or optionsDescription
Time Periodinteger142…100000Number of bars used for the typical-price average and mean-deviation calculation.

Outputs

OutputTypeDescription
CCInumberCommodity Channel Index value for the bar.

Reading the result

CCI expresses how far the current typical-price behavior is from its recent average relative to recent mean deviation. Despite its name, it is not limited to commodity markets.

The result is not tightly bounded. Large positive or negative readings describe unusual displacement for the configured local history, but the frequency of those readings depends on the market and timeframe.

Common mistakes

  1. Assuming a fixed threshold has the same rarity in every dataset.
  2. Treating an extreme as an automatic reversal.
  3. Comparing CCI with close-only indicators without remembering that its input uses the bar range.
  4. Ignoring provider differences in high and low values.

DataCat workflow notes

For regime-aware analysis, inspect both the level and how long it remains on one side of zero. Estimate threshold frequencies from the actual training dataset instead of relying only on textbook labels.

Resources

Search documentation

Search across 46 documentation pages.