What do CCI and the Ultimate Oscillator add to RSI?
Short answerEach adds information that RSI ignores. RSI uses only closes and asks whether recent closes have mostly risen or fallen. The commodity channel index (CCI) uses the high, low and close to measure how far today's typical price sits from its 20-bar average, in units of how far prices usually stray from it, so it adapts to recent volatility and has no upper or lower limit. The Ultimate Oscillator measures where each close lands within its bar's true range, averaged over 7, 14 and 28 bars, so it adds intrabar information and three timeframes. Neither turns an extreme into a forecast: in this lesson's designed example, a 1.10% rise after a quiet stretch sent CCI to 495, while a 3.78% rise in a volatile stretch left it at −58.
When the three oscillators disagree on the same day, ask what each one measures before treating the disagreement as information: often it is only a difference of scale. CCI can also stay above +100 through a whole trend, and the Ultimate Oscillator's divergence signal can fail.
Valmy noteValmy's v1 strategy language includes the simple moving average and no other indicator, so CCI and the Ultimate Oscillator are taught here for reading charts (as of 26 November 2026).
Commodity channel index (CCI): distance from the average in units of typical deviation#
The commodity channel index (CCI) measures how far the latest typical price, (high + low + close) ÷ 3, sits above or below its simple moving average, divided by 0.015 times the mean deviation: the average absolute distance of the typical prices in the window from that same average. Donald R. Lambert introduced it in Commodities magazine in 1980 as a tool for timing cyclical turns in commodity prices. Its inputs are the high, low and close. The usual lookback is 20 bars, StockCharts' default; TA-Lib's CCI function defaults to 14, so check the setting before comparing values across tools. CCI has no units and no fixed bounds; values beyond +100 or −100 are commonly read as unusually far from the average, and ±200 as more extreme.
In plain terms, CCI = (typical price − its average) ÷ (0.015 × mean deviation). A reading of +100 means the typical price is 1.5 mean deviations above its average, because 1 ÷ 0.015 ≈ 66.7 and 100 ÷ 66.7 = 1.5. A reading of 0 means it sits exactly at the average. Because the denominator shrinks when the market is quiet, the same price distance produces a larger CCI after calm periods.
Calculating CCI step by step#
To calculate CCI with a lookback of n: compute each bar's typical price, take the simple average of the last n typical prices, take the average of their absolute distances from that average (the mean deviation), then divide today's distance from the average by 0.015 × mean deviation. The example below uses n = 5 on six invented bars. It gives CCI 142.86 at bar 5 and 121.21 at bar 6.
| Bar | High | Low | Close | Typical price | 5-bar average | Mean deviation | CCI(5) |
|---|---|---|---|---|---|---|---|
| 1 | 20.9 | 19.9 | 20.40 | 20.40 | |||
| 2 | 21.2 | 20.2 | 20.70 | 20.70 | |||
| 3 | 21.0 | 20.1 | 20.55 | 20.55 | |||
| 4 | 21.3 | 20.4 | 20.85 | 20.85 | |||
| 5 | 21.8 | 20.8 | 21.30 | 21.30 | 20.76 | 0.252 | 142.86 |
| 6 | 22.4 | 21.2 | 21.65 | 21.75 | 21.03 | 0.396 | 121.21 |
- Typical price. Bar 6: (22.4 + 21.2 + 21.65) ÷ 3 = 21.75.
- Average at bar 5. (20.40 + 20.70 + 20.55 + 20.85 + 21.30) ÷ 5 = 20.76.
- Mean deviation at bar 5. The distances from 20.76 are 0.36, 0.06, 0.21, 0.09 and 0.54. Their average is 1.26 ÷ 5 = 0.252.
- CCI at bar 5. (21.30 − 20.76) ÷ (0.015 × 0.252) = 0.54 ÷ 0.00378 = 142.86.
- Bar 6. The average is 21.03. The distances are 0.33, 0.48, 0.18, 0.27 and 0.72, so the mean deviation is 0.396. CCI = (21.75 − 21.03) ÷ (0.015 × 0.396) = 0.72 ÷ 0.00594 = 121.21.
The typical price moved further above its average on bar 6 (0.72 against 0.54), yet CCI fell, because the bars in the window had also become more spread out. CCI always measures distance relative to recent variability.
Why 0.015: how often CCI stays within ±100#
StockCharts reports that Lambert chose the 0.015 constant so that roughly 70% to 80% of CCI values would fall between −100 and +100. A rough calculation shows where that range comes from: if typical prices scattered randomly around a stable average, ±100 would cover about 1.2 standard deviations and hold about 76.9% of values. Real prices often wander and trend instead, so the latest value tends to sit near the edge of its window, and the share can be much lower.
Three 1,000-bar synthetic series, built for this lesson, show how much the share depends on the kind of market:
| Synthetic series (1,000 daily bars) | CCI(10) | CCI(20) | CCI(40) |
|---|---|---|---|
| Random walk, no trend | 56.4% | 58.7% | 58.0% |
| Steady uptrend | 49.8% | 42.6% | 36.7% |
| Mean-reverting range | 63.0% | 66.3% | 72.0% |
Only the mean-reverting series with a 40-bar lookback reached Lambert's stated range. In the trending series, fewer than half of CCI(20) values were within ±100. A CCI beyond ±100 is therefore not rare, and how often it happens says something about the market as well as about the indicator. These are synthetic series and do not measure any real market.
Reading CCI on a chart#
On a chart, CCI sits below price with lines at +100 and −100. In a sideways market, readings far beyond those lines tend to come near the ends of swings. In a trend, a move above +100 can instead mark the start of strength: StockCharts describes using a move above +100 as a sign of a new uptrend, and ±100 or ±200 as overbought and oversold levels in ranges. Figure 1 shows both regimes.
- Point A, day 5. After a fall from 100.13, CCI reached −294 at a close of 94.36. Price made its low close of 92.80 on day 8 and rebounded to 97.98 by day 13.
- Point B, day 25. CCI reached +146 at 97.91, and price then fell for six days.
- Point C, day 31. CCI reached −223 at 88.92, the lowest close on the chart, before the trend began.
- The trend, days 37 to 77. The close rose from 93.73 to 120.38 (+28.4%). CCI first closed above +100 on day 43 (112). A trader who read that as a new uptrend and bought at the next open, 98.15, would have been up 22.6% at the last close. A trader who read the same reading as "overbought" and sold short would have been on the wrong side of that 22.6% rise. CCI stayed above +100 on 29 of the 41 trend days and peaked at 180.
When CCI misleads: a small move after a quiet stretch#
Because CCI divides by recent variability, a modest move after a calm period can produce an extreme reading. The reading then reflects how quiet the market had been more than how strong the move is. In Figure 2, a 3.78% rise during a volatile stretch left CCI at −58, while a 1.10% rise after a quiet stretch sent CCI to 495.
- Volatile stretch, days 1 to 30. Daily moves reached 3.78% (day 5), yet CCI stayed between −186 and +134. On day 5 it was −58, and on day 17, after a 2.90% rise, it was −1. At the end of this stretch the mean deviation of typical price was 1.23.
- Quiet stretch, days 31 to 52. No daily move exceeded 0.55%, and the mean deviation shrank to 0.12, about a tenth of its earlier size.
- The breakout, days 53 and 54. A 0.56% rise on day 53 gave CCI 236, and a 1.10% rise on day 54 gave 495. CCI then eased to 347, 243 and 170 over the next three days, and price ended the chart at 101.56.
A trader reading 495 as "extremely overbought" would be comparing it with a scale that had just been compressed. Checking the size of the move in percent, or a volatility measure such as average true range from How much does this market usually move? ATR and historical volatility, puts the reading in context.
Ultimate Oscillator: buying pressure across three timeframes#
The Ultimate Oscillator (UO) measures where closes land within their bars' true ranges, averaged over 7, 14 and 28 bars and combined on a 0 to 100 scale, with readings below 30 and above 70 as the conventional extremes. Larry Williams described it in "The Ultimate Oscillator", Technical Analysis of Stocks & Commodities, volume 3, issue 4 (July/August 1985). Its inputs are the high, low and close, including the previous close. For each bar, buying pressure = close − true low, and true range = true high − true low, where the true low is the lower of today's low and yesterday's close and the true high the higher of today's high and yesterday's close. Each average is the sum of buying pressure divided by the sum of true range over 7, 14 or 28 bars. UO = 100 × (4 × average7 + 2 × average14 + average28) ÷ 7.
A UO of 50 means closes have landed, on balance, halfway up their true ranges. The weights give the 7-bar average 4/7 of the total (57%), so the most recent week dominates, while the 14- and 28-bar averages keep a single burst from swinging the reading as far as a short oscillator would.
Calculating the Ultimate Oscillator step by step#
To calculate the Ultimate Oscillator: for each bar, find the true low and true high using the previous close, compute buying pressure and true range, sum each over the three lookbacks, divide to get three averages, and combine them with weights 4, 2 and 1. The example below uses lookbacks of 2, 4 and 8 bars instead of 7, 14 and 28 so that nine invented bars are enough. It gives UO 52.86 at bar 8.
| Bar | High | Low | Close | Previous close | True low | True high | Buying pressure | True range |
|---|---|---|---|---|---|---|---|---|
| 0 | 20.4 | 19.6 | 20.0 | |||||
| 1 | 20.6 | 19.8 | 20.4 | 20.0 | 19.8 | 20.6 | 0.6 | 0.8 |
| 2 | 20.9 | 20.3 | 20.8 | 20.4 | 20.3 | 20.9 | 0.5 | 0.6 |
| 3 | 21.0 | 20.2 | 20.3 | 20.8 | 20.2 | 21.0 | 0.1 | 0.8 |
| 4 | 20.6 | 19.9 | 20.5 | 20.3 | 19.9 | 20.6 | 0.6 | 0.7 |
| 5 | 21.4 | 21.0 | 21.3 | 20.5 | 20.5 | 21.4 | 0.8 | 0.9 |
| 6 | 21.5 | 20.9 | 21.0 | 21.3 | 20.9 | 21.5 | 0.1 | 0.6 |
| 7 | 21.2 | 20.6 | 20.7 | 21.0 | 20.6 | 21.2 | 0.1 | 0.6 |
| 8 | 21.1 | 20.5 | 21.0 | 20.7 | 20.5 | 21.1 | 0.5 | 0.6 |
- True range with a gap. Bar 5 opened above bar 4's close of 20.5. Its own high-to-low range is only 0.4, but its true low is the previous close, so its true range is 21.4 − 20.5 = 0.9 and its buying pressure is 21.3 − 20.5 = 0.8.
- Sums at bar 8. Over the last 2 bars, buying pressure is 0.6 and true range 1.2. Over 4 bars: 1.5 and 2.7. Over 8 bars: 3.3 and 5.6.
- Averages. 0.6 ÷ 1.2 = 0.5000, 1.5 ÷ 2.7 = 0.5556 and 3.3 ÷ 5.6 = 0.5893.
- Weighting. 4 × 0.5000 + 2 × 0.5556 + 0.5893 = 3.7004. UO = 100 × 3.7004 ÷ 7 = 52.86.
Williams's divergence buy rule#
StockCharts summarizes Williams's buy signal in three conditions, and the mirror image for selling:
- A bullish divergence: price makes a lower low while UO makes a higher low.
- The first UO low of the divergence is below 30.
- UO then rises above the high it made between the two lows. That is the buy signal.
The sell signal mirrors it: a bearish divergence whose first UO high is above 70, followed by UO falling below the low between the two highs. The rule requires the oscillator to confirm a turn, not just to reach an extreme.
Reading the Ultimate Oscillator on a chart#
On a chart, UO sits below price with lines at 30 and 70, and a divergence is read by comparing the two price lows with the two UO lows beneath them. Figure 3 shows a synthetic decline in which all three of Williams's conditions were met and the buy worked.
- Low 1. Price closed at 88.99 on day 11. UO's low was 18.8 on day 10, below 30, which meets condition 2.
- Low 2. Price closed lower, at 86.81 on day 29 (2.4% below Low 1), while UO's low on day 28 was higher, at 26.3. That is the divergence.
- Signal. Between the lows, UO's high was 56.1 on day 18. UO rose to 56.5 on day 34, above that high, so the rule bought at the next open: 90.42 on day 35.
- Outcome. Price never closed below Low 2 again and reached 98.14 by day 52, a gain of 8.5%. UO peaked at 75.8.
When the Ultimate Oscillator misleads: the same signal, then a failure#
Figure 4 uses exactly the same 34 days and the same buy at 90.42 as Figure 3. Only what happens after the entry differs. This is the point of the comparison: on the day of the signal, nothing in the chart or the oscillator could tell the two outcomes apart.
- Exit. Suppose the trader decided in advance to exit after a close below Low 2's 86.81. That happened on day 40 (84.76), and the position was sold at the next open, 84.76 on day 41: a loss of 6.3% before fees.
- Without the exit, the position would have been down 18.6% at the last close of 73.58. UO fell back to 21.7, deep below 30, so the oscillator was already "oversold" again while price kept falling.
Divergence rules describe a slowing decline, and a slowing decline can resume. These two figures were built so that their histories are identical. They show that a signal's outcome has to be judged over many cases, and that the exit decided before entry controls the size of the loss.
What CCI and the Ultimate Oscillator add to RSI#
RSI uses closes only and compares the average size of up-closes with down-closes; see What does RSI measure, and why do "overbought" signals fail? CCI adds the high and low and scales the distance from an average by recent variability, so it has no upper limit and reacts strongly after quiet periods. The Ultimate Oscillator adds where each close lands within its true range, including gaps, and blends three lookbacks. Because they answer different questions, their extremes do not line up.
| RSI | CCI | Ultimate Oscillator | |
|---|---|---|---|
| Inputs | Close | High, low, close | High, low, close, previous close |
| Question | Have recent closes mostly risen or fallen? | How far is price from its average, relative to recent variability? | Where did closes land within their true ranges? |
| Scale | 0 to 100 | Unbounded | 0 to 100 |
| Default | 14 bars, Wilder's smoothing | 20 bars, constant 0.015 | 7, 14 and 28 bars, weights 4, 2, 1 |
| Common extremes | 70 and 30 | ±100, ±200 | 70 and 30, with divergence rules |
| Adds | Volatility scaling and range information | Intrabar close location, gaps and three timeframes |
Same close, different bars. Suppose two bars both close at 101.0 after a previous close of 100.0. Bar X traded from 99.5 to 103.0, and bar Y from 99.9 to 101.1. RSI counts the same +1.0 gain for both. For the Ultimate Oscillator, bar X's buying pressure is 1.5 within a true range of 3.5 (0.43), because it closed well below its high, while bar Y's is 1.1 within 1.2 (0.92). CCI's typical price is 101.17 for bar X and 100.67 for bar Y, because X's high pulls it up.
Same day, three readings. On day 5 of Figure 1, RSI(14) was 23.5, CCI(20) −294 and UO 28.3: all three called the market stretched to the downside. On day 77, after a 28.4% rise, RSI was 82.6, well above 70, UO was 70.9, just above its 70 line, and CCI was 101, barely past +100. RSI saw almost only up-closes; CCI saw a price that was not far from its 20-day average in terms of recent variability, because a steady trend spreads the window's typical prices apart and enlarges the mean deviation; UO saw closes landing in the upper part of their ranges.
CCI and the Ultimate Oscillator on stock and crypto charts#
Both indicators use each bar's high and low, so trading hours and gaps affect them.
- Gaps. On a US stock, an overnight gap moves the typical price in one step, and CCI's average and mean deviation react only gradually, so gap days often produce large CCI readings. The Ultimate Oscillator's true range reaches back to the previous close, so a gap is counted in full, as bar 5 of the worked example shows. On intraday stock charts the first bar of each session carries the overnight gap. Crypto pairs trade continuously and have no session gaps.
- Calendar span. Twenty daily bars cover 20 calendar days on a crypto pair and about four weeks on a US stock, which trades about 252 days a year. UO's 28 bars cover four weeks of crypto trading and almost six weeks of stock trading.
- Venue. Highs and lows differ slightly between exchanges for the same crypto pair, so a wick on one venue can change CCI or UO there and not elsewhere.
- No volume. Neither indicator uses volume. The volume-weighted cousin of RSI, the money flow index, is covered in What changes when an indicator is weighted by volume? VWMA and the money flow index.
Check your understanding: CCI and the Ultimate Oscillator#
Question.
- CCI. Today's high is 51.0, low 49.2 and close 50.7. The 20-day average of typical price is 49.50 and the mean deviation is 0.40. What is CCI(20)? What would it be if the market had been twice as quiet, with a mean deviation of 0.20 and everything else unchanged?
- Ultimate Oscillator. The 7-, 14- and 28-bar averages of buying pressure ÷ true range are 0.62, 0.55 and 0.48. What is UO? If a week of closes near the lows pulls the 7-bar average down to 0.40 while the other two stay the same, what is UO then?
Show the answers
Answer.
- Typical price = (51.0 + 49.2 + 50.7) ÷ 3 = 50.30. CCI = (50.30 − 49.50) ÷ (0.015 × 0.40) = 0.80 ÷ 0.006 = 133.3. With a mean deviation of 0.20, CCI = 0.80 ÷ 0.003 = 266.7. The same price distance doubles the reading when recent variability halves, which is why a very high CCI after a quiet stretch needs a second look.
- UO = 100 × (4 × 0.62 + 2 × 0.55 + 0.48) ÷ 7 = 100 × 4.06 ÷ 7 = 58.0. With a 7-bar average of 0.40, UO = 100 × (1.60 + 1.10 + 0.48) ÷ 7 = 45.4. The 7-bar average carries 4/7 of the weight, so one week of weak closes moves UO by 12.6 points even though the longer averages have not changed.
Related lessons#
- Before this lesson: What does RSI measure, and why do "overbought" signals fail?
- See also: Where is price within its recent range? Stochastic, Williams %R and Stochastic RSI
- See also: How much does this market usually move? ATR and historical volatility, for true range and volatility
- See also: What do Bollinger Bands measure, and does touching a band mean anything?, another distance-from-average measure scaled by variability
- See also: What do TSI and the Awesome Oscillator smooth out?
- See also: How strong is this trend? ADX, the directional indicators and Aroon
- See also: What changes when an indicator is weighted by volume? VWMA and the money flow index
- See also: Why did my backtest work when live trading didn't? Overfitting and data snooping