Momentum

CCI Indicator on a Live Gold Chart

The CCI shows how far the typical price of a candle, (high + low + close) ÷ 3, sits from its average over the last 20 candles. The distance is divided by the average size of the swings, so the line has no fixed ceiling and often travels beyond 100 and −100. Because the yardstick is recent swing size, a run of small candles can make the next ordinary one read as an extreme.

Loading the live chart.

Close
–
CCI
–

Open the gold chart

What it shows

The CCI line runs in a pane below price, between guides at 100, 0 and −100. With a second line type picked, an average of the CCI is drawn over it, and with SMA + Bollinger Bands two more lines mark the bands around that average.

How Pravex works it out

  1. Take the source for each candle. The default is hlc3, (high + low + close) ÷ 3.
  2. Work out the simple average of the source over the Length, 20 candles, and the mean absolute deviation: the average distance of each of those 20 values from the average.
  3. CCI = (source − average) ÷ (0.015 × mean absolute deviation). The 0.015 is a fixed constant. If every value in the window is the same the deviation is zero and the candle gets no reading.
  4. The optional smoothing line is an average of the CCI over its own length. The second line type starts at None, so this line is hidden until you pick one.

Settings

SettingDefaultWhat changing it does
Length20How many candles the average and the deviation cover. A shorter length makes the CCI swing wider and cross 100 more often.
Sourcehlc3Which price the CCI is built on. hlc3 includes the close and both extremes of the candle; close alone ignores the wicks.
Second line typeNoneThe kind of average drawn over the CCI: None, SMA, SMA + Bollinger Bands, EMA, SMMA (RMA), WMA or VWMA. Skip VWMA on gold, where the bars carry no volume to weigh by.
Second line length14How many CCI values the second line averages. It appears in the settings once a type is chosen.
Band width in standard deviations2With SMA + Bollinger Bands as the type, this sets the band distance from the CCI average in standard deviations.

How traders read it

Readings above 100 say the typical price is further above its average than a normal swing. Below −100 the same on the downside. One school reads a rise through 100 as the start of a strong move and a drop back under it as that move cooling off. Others fade the extremes.

The zero line marks the average itself. A line that keeps crossing zero says price is chopping around its 20-candle mean, and a line that stays on one side says price is leaning one way.

Turn the smoothing on to see the CCI’s own trend. A CCI crossing its smoothing average is a calmer trigger than the raw line crossing zero.

When it misleads

The scale is relative to recent swings, so ±100 is not a fixed edge. After a long quiet run in gold the deviation shrinks, and an ordinary candle can throw the CCI to 200. After a wild session the same candle barely moves it. The line also reacts only to the last 20 candles, so it forgets a big move after it leaves the window.

Questions and answers

How far from its average is price when the CCI passes 100?

The typical price is more than about 1.5 average swings above its 20-candle average (100 × 0.015 = 1.5). It says the candle sits well above its recent norm. It does not say price has to come back.

Is CCI 14 or CCI 20 better for gold?

Pravex uses 20 on hlc3. A 14 window has fewer swings in its deviation, so ordinary candles throw it past 100 more often; 20 settles a little more. If you mostly fade extremes, the longer window gives fewer false ones.

Why is the CCI not limited to 100 and −100?

Nothing in the formula caps it. The line is a distance measured in average swings, so a strong move can take it to 200 or more.

What is the 0.015 in the CCI formula?

A fixed scaling constant in our code and in the original formula. It was picked so that most readings land between 100 and −100 in normal markets. Changing the length does not change it.

Related: Relative Strength Index, Williams Percent Range, Stochastic, Bollinger Bands, every indicator.

Not financial advice. Read our disclaimer.

Pro charts. Zero paywalls.

Charts for gold, oil, US indices and crypto, with every tool free to use.

Open the chart

No card, no trial, no upgrade pop-ups.