How CMO Is Calculated (Formula, Inputs, and Verification)

Learn how CMO is calculated including formula inputs limits and checks.

Direct answer: how CMO is calculated

CMO (Chande Momentum Oscillator) is calculated by comparing the total size of recent upward price changes (“gains”) with the total size of recent downward price changes (“losses”) over a fixed lookback window, and converting that comparison into an oscillator value.

A common way to express it is:

CMO = 100 × (SumGains − SumLosses) / (SumGains + SumLosses)

Where:

  • SumGains is the sum of the positive price changes over the lookback period.
  • SumLosses is the sum of the absolute values of the negative price changes over the lookback period.

This produces a value that typically ranges between −100 and +100 when the denominator is non-zero.

Mechanics: define the inputs and the step-by-step calculation

1) Choose the lookback length

Pick an integer lookback length, usually denoted as N. The calculation at a given time uses the most recent N price-to-price changes in the series.

Assumption for verification: you must use the same N every time you compute CMO for a comparison to be meaningful.

2) Choose the price series

CMO is computed from a time series of prices. The price can be defined in several ways (for example, closing price), but whatever you use must be consistent.

Assumption for example: the calculations below use a single price series P(t) and define changes from one time step to the next.

3) Compute price changes for each step

For each time step i within the lookback window, compute the change:

  • ΔP(i) = P(i) − P(i−1)

Now split each change into two components:

  • Gain(i) = ΔP(i) if ΔP(i) > 0, otherwise 0
  • Loss(i) = −ΔP(i) if ΔP(i) < 0, otherwise 0

Note the sign convention: losses are stored as positive magnitudes.

4) Sum gains and losses over the lookback window

  • SumGains = Σ Gain(i) for i in the last N steps
  • SumLosses = Σ Loss(i) for i in the last N steps

5) Apply the oscillator formula

Compute:

  • CMO = 100 × (SumGains − SumLosses) / (SumGains + SumLosses)

Important: if SumGains + SumLosses = 0, then the oscillator is mathematically undefined because you would divide by zero. In real implementations, tools may handle this in different ways (for example, leaving it blank or assigning a specific value). If you want independent verification, check exactly how your method handles the zero-denominator case.

Evidence or example: a small numeric walk-through

Assume N = 4 and you use a price series P with these values at consecutive time steps:

  • P(0)=100, P(1)=102, P(2)=101, P(3)=103, P(4)=103

Step 1: compute changes over the last 4 steps:

  • ΔP(1)=102−100=+2 → Gain=2, Loss=0
  • ΔP(2)=101−102=−1 → Gain=0, Loss=1
  • ΔP(3)=103−101=+2 → Gain=2, Loss=0
  • ΔP(4)=103−103=0 → Gain=0, Loss=0

Step 2: sum gains and losses:

  • SumGains = 2 + 0 + 2 + 0 = 4
  • SumLosses = 0 + 1 + 0 + 0 = 1

Step 3: compute CMO:

  • CMO = 100 × (4 − 1) / (4 + 1)
  • CMO = 100 × 3/5
  • CMO = 60

What this means in calculation terms: the net direction is positive because the summed gains outweigh the summed losses over the chosen window.

Limitations and risks: what can go wrong and why it varies

1) Undefined or unstable values when gains and losses are both zero

If, over the lookback window, the price never increases or decreases (all changes are zero), then SumGains = 0 and SumLosses = 0, so the denominator becomes zero. Different platforms may display different outputs. This is a key failure mode for independent checking.

2) Sensitivity to how you define the input price

CMO’s value depends on the chosen price series (for example, closing price vs another consistent price definition). Even if the “lookback” and formula are the same, using a different input series can change the computed gains and losses.

3) Sensitivity to the lookback length (N)

Changing N changes which past changes are included, so CMO can shift. Longer windows smooth more variation by aggregating more steps; shorter windows react more to recent changes. This is not a problem with the formula, but it affects comparability across charts.

4) Not a guarantee about future movement

CMO summarizes past changes within a fixed window; historical patterns in CMO do not establish that any future direction will follow. Costs, execution differences, and market regime changes can all alter how price behaves after a given oscillator reading.

5) Data and sampling differences

If you compute CMO from different timeframes (or from data that differs in how time steps are formed), the set of ΔP values changes, which changes CMO.

Verification and next question: how to check your work

To independently verify that you computed CMO correctly:

  1. Confirm your price definition (which series you used) and your lookback length N.
  2. Recompute ΔP(i) for each step in the window.
  3. Split each ΔP into Gain and Loss magnitudes using the same sign rule.
  4. Sum gains and losses and verify the denominator (SumGains + SumLosses) is non-zero.
  5. Apply CMO = 100 × (SumGains − SumLosses) / (SumGains + SumLosses).

Next question to consider: “How do CMO settings change its behavior?” That comes down to the choice of N and the price series, which both directly affect the gains/losses sums.

Trading foreign exchange and CFDs involves substantial risk. Information on FoxiForex is educational and is not personal financial advice. Sponsored placements are labelled clearly.