The Commodity Channel Index (CCI), developed by Donald Lambert, is a versatile momentum oscillator that measures the current price level relative to an average price level. It is widely used to identify overbought/oversold conditions and cyclical turns.
- **`CCI_Pro.mq5`**: The main indicator. It plots the CCI line, a configurable moving average signal line, and optional **Bollinger Bands** calculated on the CCI itself.
- **`CCI_Oscillator_Pro.mq5`**: Displays the difference between the CCI and its signal line as a histogram, providing a clear visual of momentum acceleration/deceleration.
- **`CCI_PercentB_Pro.mq5`**: A %B oscillator that shows the CCI's position relative to its Bollinger Bands, scaled from 0 to 100.
The core logic is encapsulated in a robust engine.
- **Composition:** The calculator internally uses our universal `MovingAverage_Engine.mqh` to handle the smoothing of the Signal Line. This allows for advanced smoothing types (like DEMA or TEMA) beyond the standard SMA.
- **Reusability:** The `CCI_Oscillator_Pro` and `CCI_PercentB_Pro` calculators use composition to include the main `CCCI_Calculator`, ensuring that all indicators in the suite share the exact same mathematical foundation.
- An elegant inheritance model (`CCCI_Calculator` and `CCCI_Calculator_HA`) allows all indicators in the family to dynamically choose the correct calculation engine at runtime based on user input.
- **Overbought/Oversold:** Readings above +100 and below -100.
- **Crossovers:** CCI line crossing its signal line.
- **Bollinger Bands:** The bands show the volatility *of the CCI itself*. A "squeeze" on the CCI bands can foreshadow a significant breakout in price momentum.
- **`CCI_Oscillator_Pro`:**
- Visualizes the momentum of the CCI relative to its signal line. A zero-line cross confirms a signal line crossover on the `CCI_Pro`. Growing bars indicate accelerating momentum, while shrinking bars indicate decelerating momentum.
- **`CCI_PercentB_Pro`:**
- **Overbought/Oversold:** Provides a normalized (0-100) view of overbought/oversold conditions. Readings above 80-100 or below 0-20 are significant.
- **"Headroom":** Shows how much "room" the CCI has to move before it becomes extreme relative to its own recent volatility.