CCI (Commodity Channel Index)
The CCI (Commodity Channel Index) is a momentum-based oscillator used to help determine when an investment vehicle is reaching a condition of being overbought or oversold. It measures the current price level relative to an average price level over a given period of time. When the CCI is above +100, it is considered overbought, and when it is below -100, it is considered oversold. It can also be used to identify trend strength and potential trend reversals.
Arguments
| Name | Description |
|---|---|
period | Number of periods (integer greater than 0). Default is 20. |
Useful Signal Expressions
1. CCI Overbought
Signal:
cci(20).gt(100)
Explanation: The CCI with a period of 20 is above 100, which can indicate an overbought condition, suggesting a potential selling opportunity.
2. CCI Oversold
Signal:
cci(20).lt(-100)
Explanation: The CCI with a period of 20 is below -100, which can indicate an oversold condition, suggesting a potential buying opportunity.
3. CCI Zero Line Cross (Bullish)
Signal:
cci(20).crosses_above(0)
Explanation: The CCI crosses above the zero line, which can be interpreted as a bullish signal.
4. CCI Zero Line Cross (Bearish)
Signal:
cci(20).crosses_below(0)
Explanation: The CCI crosses below the zero line, which can be interpreted as a bearish signal.
