A price drifts away from its average, comes back, then drifts away again. The CCI (Commodity Channel Index) measures how far the price has moved from its recent average, taking the marketโs usual agitation into account. A CCI of +100 means โclearly above the average for this marketโ. It is a measure of distance, not a forecast.
How it is calculated
For each candle, AI Signals computes the typical price TP = (high + low + close) รท 3. It takes its simple average over 20 candles, then the mean deviation: the average of the absolute gaps between each TP and that average. Finally CCI = (TP โ average) รท (0.015 ร mean deviation). The constant 0.015 comes from the original formula.
- Reading example: TP 12 above the average, mean deviation of 8 โ CCI = 12 รท (0.015 ร 8) = 100.
- A positive CCI: the typical price is above its average. Negative: below.
- Since we divide by the usual agitation, +100 means the same thing in a calm market and a nervous one.

Reading the signal in AI Signals
The โSignalโ setting (sigMode) has two modes. Mode 1 (default): bias. Bullish if the CCI is positive, bearish if negative; the signal appears when it crosses zero. Mode 2: return from the extremes. Buy when the CCI comes back above โ100 (it leaves the low zone), sell when it falls back below +100 (it leaves the high zone); the state is kept until the opposite event.

The settings
- Period (period): 20 by default (2 to 200). Shorter, the CCI is jumpy and often reaches ยฑ100; longer, it is calmer.
- Signal (sigMode): 1 = sign around zero (default), 2 = return from ยฑ100.
- Level (cciLvl): 100 by default (20 to 300). It only serves mode 2. Larger, fewer but more extreme signals; smaller, more.
- These values are conventions: do not tune them to โfitโ the past.
The pitfalls
The CCI is not bounded: it can exceed +200 or โ200 in a strong trend. Being above +100 is not a sell signal: in a trend the CCI can stay there for a long time, and a sell on leaving the high zone is often premature. In mode 1, a flat market makes the CCI oscillate around zero and multiplies small signals. On spike indices (Boom/Crash), a sudden spike distorts the average and the mean deviation for several candles.

Key takeaways
- CCI = (typical price โ average) รท (0.015 ร mean deviation), over 20 candles by default.
- Mode 1: positive = bullish, negative = bearish. Mode 2: buy on the return above โ100, sell on the return below +100.
- It is not bounded: large values signal a strong trend as much as an excess.
- Combine it with a trend filter (ADX, MA 200) or another oscillator to require several confirmations.
๐ Lesson test
Log in to take this lessonโs test. Once you have passed all the tests, you will receive a certificate in your name.
Log inThese lessons are for understanding and are not investment advice. No method guarantees winning.