Function calculate_cmo

Source
pub fn calculate_cmo(
    df: &DataFrame,
    window: usize,
    column: &str,
) -> PolarsResult<Series>
Expand description

Calculates Chande Momentum Oscillator (CMO) Formula: CMO = 100 * ((Sum of gains - Sum of losses) / (Sum of gains + Sum of losses))

The CMO indicator is similar to other momentum oscillators but has a different formula. It oscillates between -100 and +100, with overbought/oversold typically at +/-50.

§Arguments

  • df - DataFrame containing the price data
  • window - Window size for CMO calculation (typically 14)
  • column - Column name to use for calculations (default “close”)

§Returns

Returns a PolarsResult containing the CMO Series