Skip to main content

cci

Calculate the Commodity Channel Index (CCI).

The CCI is designed to detect beginning and ending market trends. The range of 100 to -100 is the normal trading range. CCI values outside of this range indicate overbought or oversold conditions. You can also look for price divergence in the CCI. If the price is making new highs, and the CCI is not, then a price correction is likely.

Example:​

from openbb import obb
stock_data = obb.equity.price.historical(symbol="TSLA", start_date="2023-01-01", provider="fmp")
cci_data = obb.technical.cci(data=stock_data.results, length=14, scalar=0.015)

Parameters​

NameTypeDescriptionDefaultOptional
dataList[Data]The data to use for the CCI calculation.NoneFalse
indexstrIndex column name to use with data, by default "date".dateTrue
lengthPositiveIntThe length of the CCI, by default 14.14True
scalarPositiveFloatThe scalar of the CCI, by default 0.015.0.015True

Returns​

The CCI data.