What is CCI?
The Commodity Channel Index measures the gap between typical price, the average of each bar's high, low and close, and its own simple moving average. That gap is divided by the average distance of recent prices from the average, then scaled by a constant so that most readings fall between +100 and -100. Altrady Charts draws CCI in its own pane with dashed levels at +100 and -100.
CCI shows how unusual the current price is compared with its recent average and spread. It has no upper or lower bound, and it does not by itself say whether a stretched reading will continue or reverse.
How to use CCI
- Above +100 or below -100. Price is unusually far above or below its average for its recent variability. Some traders read this as strength in that direction, others as stretch to fade; both uses exist, and neither works in every market.
- The zero line. Above zero, typical price is above its 20-bar average; below zero, below it.
- Divergence. A new price high with a lower CCI high means price is less far above its average, relative to recent variability, than it was at the previous high.
- Period length. A shorter length crosses ±100 more often; a longer one does so less often.
These are ways to read the line, not entry signals on their own.
Settings
| Setting | Default | What it changes |
|---|---|---|
| Length | 20 | Bars in the moving average and the mean deviation. Lower makes CCI more jumpy and more often beyond ±100; higher is smoother. Minimum 1. |
| Source | hlc3 | Which price is measured. The default is typical price, the average of high, low and close. Close, open, high, low and hl2 are also available. |
Adjust the length and price source in the indicator settings. The ±100 levels are fixed.
Calculation
CCI is the distance of price from its moving average, divided by 0.015 times the mean absolute deviation of the same window:
tp = (high + low + close) / 3
ma = SMA(tp, 20)
md = average of |tp - ma| over the last 20 bars
CCI = (tp - ma) / (0.015 * md)
The deviation is the mean absolute deviation, every bar in the window measured against the current average, not a standard deviation. The 0.015 constant has no meaning of its own: it scales the result so that most readings, roughly 70 to 80 percent, fall inside ±100.
The first value appears on the 20th bar of loaded history, once a full window exists.
Limitations
- It is unbounded. CCI can move far beyond ±100 in a sharp move, so there is no fixed extreme.
- Two opposite readings of ±100. Beyond +100 can be read as a breakout or as overbought. The indicator does not tell you which applies.
- It lags. The 20-bar average and deviation adjust to a new price level gradually.
- The live candle moves. The current bar's value changes until that bar closes.
- It depends on timeframe and length. How often CCI crosses ±100 changes with both, so a threshold that suits one setting does not carry over.
Frequently asked questions
The Commodity Channel Index is an oscillator that measures how far typical price sits from its own moving average, in units of the average deviation over the same window. Despite the name, it can be used on any market, including crypto.
Readings above +100 or below -100 mean price is unusually far from its average. Traders use these either as signs of a strong move or as signs of a stretched one, so decide which reading fits your approach and test it. The zero line shows whether price is above or below its average.
Yes. The indicator declares two inputs: Length, default 20 with a minimum of 1, and Source, default hlc3, the typical price. Open the indicator's settings on the chart to change them. The +100 and -100 levels are fixed.
The constant only sets the scale. Dividing by 0.015 times the mean deviation puts roughly 70 to 80 percent of readings between +100 and -100, which is why the levels are drawn there.
Values on bars that have already closed are not revised. The current candle's value moves while it is still live and settles when it closes. Each value uses only a fixed window of past bars, so loading older history does not change it.
Use the Add to chart button at the top of this page. It opens BTC/USDT on Binance in the Altrady Charts terminal with the built-in Commodity Channel Index already applied. On any other market, open the indicator picker on the chart and choose Commodity Channel Index from the Oscillator group.