Skip to content

Chande Momentum Oscillator (CMO) ​

Created by Tushar Chande, the Chande Momentum Oscillator is a weighted percent of higher prices over a lookback window. [Discuss] 💬

Loading chart data...
csharp
// C# usage syntax
IReadOnlyList<CmoResult> results =
  bars.ToCmo(lookbackPeriods);

Parameters ​

paramdescription
lookbackPeriods
int
Number of periods (N) in the lookback window. Must be greater than 0. Default is 14.

Historical price bars requirements ​

You must have at least N+1 periods of bars to cover the warmup periods.

bars is a collection of generic TBar historical price bars. It should have a consistent frequency (day, hour, minute, etc). See the Guide for more information.

Response ​

csharp
IReadOnlyList<CmoResult>
  • This method returns a time series of all available indicator values for the bars provided.
  • It always returns the same number of elements as there are in the historical price bars.
  • It does not return a single incremental indicator value.
  • The first N periods will have null values for CMO since there's not enough data to calculate.

CmoResult ​

propertydescription
Timestamp
DateTime
Date from evaluated TBar
Cmo
double?
Chande Momentum Oscillator

Utilities ​

See Utilities and helpers for more information.

Chaining ​

This indicator may be generated from any chain-enabled indicator or method.

csharp
// example
var results = bars
    .Use(CandlePart.HL2)
    .ToCmo(..);

Results can be further processed on Cmo with additional chain-enabled indicators.

csharp
// example
var results = bars
    .ToCmo(..)
    .ToEma(..);

See Chaining indicators for more.

Streaming ​

Use the buffer-style List<T> when you need incremental calculations without a hub:

csharp
CmoList cmoList = new(lookbackPeriods);

// call from your WebSocket or SSE message handler
void OnBarReceived(IBar bar) => cmoList.Add(bar);

// based on `ICollection<CmoResult>`; fills as the handler runs
IReadOnlyList<CmoResult> results = cmoList;

Subscribe to a BarHub for advanced streaming scenarios:

csharp
BarHub barHub = new();
CmoHub observer = barHub.ToCmoHub(lookbackPeriods);

// call from your WebSocket or SSE message handler
void OnBarReceived(IBar bar) => barHub.Add(bar);

// results fill as the handler runs
IReadOnlyList<CmoResult> results = observer.Results;

See the guide for more information.

See Buffer lists and Stream hubs for full usage guides.