Commodity Channel Index/RSI
Feb 6, 2016

The Commodity Channel Index/RSI indicator provides a dual-oscillator framework that combines two different lengths of the Commodity Channel Index (CCI) and Relative Strength Index (RSI) to help traders identify momentum shifts and overbought/oversold conditions simultaneously.
Usage
The indicator can be used to identify trend direction and potential reversals by observing the interaction between short-term and long-term oscillators.
- Trend Identification: When the short-term lines (CCI-5 and RSI-5) are trading above their long-term counterparts (CCI-14 and RSI-14), it suggests bullish momentum. Conversely, when they are below, it suggests bearish momentum.
- Crossovers: Traders can look for crossovers between the fast and slow lines of the same indicator type as potential entry or exit signals. For example, a CCI-5 crossing above the CCI-14 may indicate a bullish surge.
- Convergence: Observing both CCI and RSI together allows traders to look for confluence. If both indicators show similar crossover or overbought/oversold behavior, the signal strength may be considered higher.
Details
The script calculates two distinct sets of oscillators:
- Commodity Channel Index (CCI): Calculated using the standard formula where the source is compared to its Simple Moving Average (SMA) and divided by the mean absolute deviation.
- Relative Strength Index (RSI): Calculated using the Relative Moving Average (RMA) of gains and losses over the specified periods.
By plotting two different periods (14 and 5) for each indicator, the tool highlights both the broader market trend and the immediate price fluctuations. Note that the CCI and RSI operate on different scales, so they are plotted together in the same pane for comparative visual analysis.
Settings
- Length 1: Determines the lookback period for the long-term CCI and RSI (Default: 14).
- Length 2: Determines the lookback period for the short-term CCI and RSI (Default: 5).
- Source: Selects the price data used for all calculations (e.g., Close, Open, High, Low).
FAQ
How do I interpret the different lines?
The green and blue thick lines represent the CCI (14 and 5 periods respectively), while the red and white/black thin lines represent the RSI (14 and 5 periods respectively).
How can I set up alerts for crossovers?
The indicator includes built-in alert conditions for when the short-term CCI crosses the long-term CCI, and when the short-term RSI crosses the long-term RSI. You can activate these via the "Create Alert" dialog in TradingView.
How do I access Commodity Channel Index/RSI?
You can get access on the LuxAlgo Library for charting platforms like TradingView, MetaTrader (MT4/MT5), and NinjaTrader for free.
Free indicator
Get free access to this indicator on the platforms below.
Unlock the entire LuxAlgo Library
Every indicator, every strategy, full charts, and complete access to Quant — our AI agent.