Help
 Print
Commodity Channel Index (CCI) indicator

The CCI (Commodity Channel Index) is a momentum oscillator that measures how far the price has moved away from its own recent average. High positive readings mean the price is stretched well above that average; low negative readings mean it is well below it. Despite the name, it is used on every asset class, not just commodities. You can read more about it on its Wikipedia page.

The conventional reading is that above +100 the stock is overbought or in a strong uptrend, below -100 it is oversold or in a strong downtrend, and between the two it is in its normal range. But the scale has no ceiling: a powerful move can push the CCI past +200 or -300, and that is exactly the point. The number doesn't just tell you the stock is extended, it tells you how extended, and how it compares to the last time it got this stretched.

Alongside the CCI itself, Samurai plots a moving average of the CCI as a signal line (default: 14 days). This is a moving average of the indicator, not of the price, it smooths the CCI line, and the relationship between the two is what tells you whether momentum is turning.

Why use it?

An oscillator tells you a stock is stretched. It does not tell you when it is going to snap back, and a stock that is oversold can stay oversold for weeks while you lose money waiting. This is the oldest problem with trading extremes.

The CCI filter is built to solve it, because it lets you ask two questions at the same time:
  • Where is the price relative to its average? The zone tells you whether there's an opportunity worth caring about: deeply oversold, strongly overbought, or somewhere unremarkable in between.
  • Has momentum actually turned? The signal line tells you whether the move is still going against you or has started to roll over.
Either one on its own is a partial picture. Together, they describe a setup: the stock is oversold and the CCI has just crossed back above its signal line. That's a stock that has stopped falling, not merely one that has fallen a lot. For an options trader deciding when to sell puts, open a debit spread, or step in front of a move, that difference is most of the edge.

Because the scale is unbounded, CCI is also the natural tool for finding genuinely rare extremes. A -250 reading is a very different situation from a -110 reading, and CCI is one of the few indicators that will tell you so.

How to use the CCI indicator in Samurai

You can use the CCI indicator to:
  • Find stocks in overbought or oversold territory, or at genuinely extreme readings well beyond the standard bands.
  • Find stocks that have just entered or just left an extreme zone.
  • Find stocks whose momentum has turned, using the crossover between the CCI and its signal line.
  • Combine the two: find stocks that are stretched and showing a confirmed turn, the strongest setups this filter can express.
  • Require an extreme to have lasted, so you only see stocks that have been oversold for a week rather than for an afternoon.
  • Add CCI as a column and sort by it to rank your trade opportunities (Pro tip: you can also save the scan).

The Filter

The CCI filter has two views.

Basic view gives you ready-made conditions in one click. They fall into four groups:

Where the CCI is now:
  • CCI overbought: above +100.
  • CCI oversold: below -100.
  • CCI neutral: between -100 and +100.
Where the CCI has just moved:
  • CCI moved to overbought: crossed above +100 in the last day.
  • CCI moved to oversold: crossed below -100 in the last day.
  • CCI moved out of overbought: was above +100 and has just dropped back into the normal range.
  • CCI moved out of oversold: was below -100 and has just climbed back into the normal range.
Where the CCI sits against its signal line:
  • Above its MA / Below its MA: momentum currently leaning up or down.
  • Crossed above its MA / Crossed below its MA: momentum has just turned, in the last day.
Both at once:
  • Bullish confirmation in oversold: the CCI is below -100 and has just crossed above its signal line. A stock that is beaten down and starting to turn.
  • Bearish confirmation in overbought: the CCI is above +100 and has just crossed below its signal line. A stock that is extended and starting to roll over.

And Any, for no CCI condition at all.

Advanced view exposes the same controls the presets are built from, so you can set your own thresholds, your own dwell times, and your own lengths:
  • The range block: turned on with the Filter by CCI range checkbox: a From / To range plus a Min. periods inside/outside range setting.
  • The signal line block: MA of CCI Length and MA Relation, plus a follow-up field whose meaning depends on the relation you pick.
The two blocks are independent. Use one, the other, or both, and when you use both, a stock has to satisfy each of them to appear in your results. That combination is what the confirmation presets do, and in Advanced you can build your own versions of them.

Settings

Length: in days, default 20. This is the lookback for the CCI itself. During market hours the current day is treated as a provisional bar built from the latest traded price and the session's running high and low, so the CCI updates in real time.

From / To: the CCI range that defines the zone you care about. Unlike most oscillators the scale is signed and open-ended, so these fields accept negative numbers and either one can be left empty for an open-ended bound. Some examples:
  • From 100, To blank: overbought, with no upper limit.
  • From blank, To -100: oversold, with no lower limit.
  • From −250, To -100: deeply oversold, but excluding the truly catastrophic readings.
Min. periods inside / outside range: how long the CCI has to have been in (or out of) the range above, in days. Click the word to switch between inside and outside. This one setting produces two very different filters:

Breadth: set inside to 5, and you only get stocks that have been in the zone for at least five days. Useful for finding genuinely persistent extremes.

Cross: set outside to 1, and you only get stocks that were outside the zone yesterday and are inside it today. That is, stocks that have just entered it.

MA of CCI Length: in days, default 14. The length of the moving average applied to the CCI. It is independent of the CCI Length above, changing one does not change the other. Worth repeating that this is a moving average of the indicator, not of the price.

MA Relation: how the CCI should sit against its signal line. Four options, in two pairs:
  • Is above its MA / Is below its MA: this is a state variable. The follow-up field, Min. days on that side of its MA, asks how long that state must have held. Set it to 5 to find sustained momentum rather than a single day of it.
  • Crossed above its MA / Crossed below its MA: this is an event variable. The follow-up field, Crossover lookback (days), is the window in which the cross must have happened. Set it to 1 for a cross on the most recent bar, or widen it to catch setups from earlier in the week.


Common use cases

  • CCI is in the overbought zone: (1) Length 20 (default), (2) From: 100, To: blank, (3) Min. periods inside range: 0
  • CCI just crossed into oversold: (1) Length 20, (2) From: blank, To: −100, (3) Min. periods outside range: 1 (it was outside the zone at least one day before entering it)
  • CCI crossed out of oversold after a week down there: (1) Length 20, (2) From: −100, To: blank, (3) Min. periods outside range: 5
  • CCI has been overbought for two weeks: (1) Length 20, (2) From: 100, To: blank, (3) Min. periods inside range: 10
  • Deeply oversold: (1) Length 20, (2) From: −400, To: −200
  • Momentum has just turned up: (1) range block off, (2) MA of CCI Length: 14, (3) MA Relation: Crossed above its MA, (4) Crossover lookback: 1

Read more

About Technical analysis Engine - KB
About RSI - KB
About Bollinger Bands - KB
About MA indicator - KB
About MA Crossover indicator - KB
About MACD indicator - KB
About Stochastic Oscillator - KB
About the ADX indicator - KB
About the Parabolic SAR indicator - KB
Was this article helpful?