# Commodity Channel Index (CCI)

#### Description <a href="#description_19" id="description_19"></a>

The Commodity Channel Index (CCI), which was created by Donald Lambert and actually featured in Commodities magazine in 1980, is a versatile indicator that can be used for identifying a new trend or as a warning of extreme conditions. Lambert originally developed the CCI as a means to identify cyclical turns in commodities – however, the indicator can also successfully be applied to ETFs, indices, stocks and various other securities. In general, what CCI does is to measure the current price level relative to an average price level over a specified period of time. When prices are well above their average, CCI is relatively high. When prices are far below their average, CCI is relatively low. This is how CCI can be used for identifying overbought and oversold levels.

#### Interpretation <a href="#interpretation_12" id="interpretation_12"></a>

CCI measures the difference between a securitys price change and its average price change. High positive readings indicate that prices are well above their average, which is a show of strength. Low negative readings indicate that prices are well below their average, which is a show of weakness.

The Commodity Channel Index (CCI) can be used as either a coincident or leading indicator. As a coincident indicator, surges above +100 reflect strong price action that can signal the start of an uptrend. Plunges below -100 reflect weak price action that can signal the start of a downtrend.

As a *leading indicator*, *momentum oscillators*, chartists can look for overbought or oversold conditions that may foreshadow a mean reversion. Similarly, bullish and bearish divergences can be used to detect early momentum shifts and anticipate trend reversals.

#### Further information <a href="#further-information_11" id="further-information_11"></a>

VTAD: <http://vtadwiki.vtad.de/index.php/Commodity_Channel_Index>

#### Usage <a href="#usage_20" id="usage_20"></a>

```csharp
CCI(int period)
CCI(IDataSeries inSeries, int period)
CCI(int period)[int barsAgo]
CCI(IDataSeries inSeries, int period)[int barsAgo]
```

#### Return value <a href="#return-value_20" id="return-value_20"></a>

**double**

When using this method with an index (e.g. **CCI**(14)\[**int** barsAgo] ), the value of the indicator will be issued for the referenced bar.

#### Parameters <a href="#parameters_18" id="parameters_18"></a>

inSeries Input data series for the indicator

period Number of bars included in the calculations

#### Visualization <a href="#visualization_21" id="visualization_21"></a>

![Commodity Channel Index (CCI)](https://agenatrader.github.io/AgenaIndicator-documentation/media/CCI.jpg)

#### Example <a href="#example_20" id="example_20"></a>

```csharp
//Output for the CCI value calculated using 14 periods
Print("The value of the Commodity Channel Index is: " + CCI(14));
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://indicators.agenatrader.com/standard-indicators/commodity-channel-index-cci.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
