The `StochCMO_Slow_Pro` is an advanced "momentum-of-momentum" oscillator. It applies the classic Slow Stochastic formula not to price, but to the output of the **Chande Momentum Oscillator (CMO)**.
This creates a unique analytical tool that measures overbought and oversold conditions in the market's "pure" momentum itself. While the standard Stochastic RSI measures the momentum of a smoothed momentum (RSI), the Stochastic CMO measures the momentum of a more raw, direct momentum (CMO).
The result is a highly responsive oscillator that can provide very early signals of momentum exhaustion. It consists of two lines:
* **%K Line:** The main oscillator line.
* **%D Line:** A moving average of the %K line, serving as a signal line.
## 2. Mathematical Foundations and Calculation Logic
The calculation is a sequential, three-stage process.
### Required Components
* **CMO Period (N):** The lookback period for the base CMO calculation.
* **Stochastic Periods:** %K Period, Slowing Period, and %D Period.
* **Source Price (P)**.
### Calculation Steps (Algorithm)
1.**Calculate the Chande Momentum Oscillator (CMO):** First, the standard CMO is calculated over period `N`, resulting in a value series oscillating between -100 and +100.
Unlike basic implementations that recalculate the entire history on every tick, this indicator employs an intelligent incremental algorithm.
* **State Tracking:** It utilizes `prev_calculated` to process only new bars.
* **Persistent Buffers:** Internal buffers (CMO, Raw %K) persist their state between ticks.
* **Robust Offset Handling:** The engine correctly handles the initialization periods of the chained calculations.
* **Object-Oriented Logic:**
* The Heikin Ashi version (`CStochasticCMOSlowCalculator_HA`) is achieved simply by instructing the main calculator to instantiate the Heikin Ashi version of the CMO module.
The StochCMO is a highly sensitive oscillator. Its signals should be interpreted in the context of the broader market trend.
* **Comparison to StochRSI:**
* **StochCMO (This indicator):** Is based on the "raw" momentum of the CMO. Its signals are **faster and more responsive**, but can also be more "jagged" or "noisy." It excels at identifying the very first signs of momentum exhaustion.
* **StochRSI:** Is based on the smoothed momentum of the RSI. Its signals are **smoother and more rounded**, making them potentially more reliable for confirming larger momentum shifts, but they may appear later.
* **Overbought/Oversold Levels:**
* **Values > 80 (Overbought):** Indicates that the raw bullish momentum has been extremely strong and may be overextended. This can be a very early warning of a potential bearish reversal.
* **Values < 20 (Oversold):** Indicates that raw bearish momentum has been extreme and may be exhausted, signaling a potential bullish reversal.
* **Crossovers:**
* When the **%K line (blue) crosses above the %D line (red)**, it signals a bullish shift in the momentum-of-momentum.
* When the **%K line (blue) crosses below the %D line (red)**, it signals a bearish shift.
* **Strategy:** Due to its high sensitivity, the StochCMO is particularly useful for **scalping** or for **timing entries within an established trend**. For example, in a strong uptrend, a dip of the StochCMO into the oversold zone (<20) followed by a bullish crossover can signal an excellent entry point on a pullback.