Skip to content

Chande Momentum Oscillator

CMO measures the difference between the sum of positive and negative price changes.

Method

tm.ta.cmo(source, timeperiod)

Inputs

ParameterArgument typeDescriptionDefault Value
sourcepd.SeriesInput data series-
timeperiodintNumber of periods for the indicator14

Outputs

OutputType
cmonp.ndarray

Example usage

strategy.py
import tradomate as tm
@tm.strategy()
def my_strategy(config: tm.TradomateConfig, data: tm.TradomateData):
# Trying out Chande Momentum Oscillator
cmo = tm.ta.cmo(data.close, timeperiod=14)
# Get the last value and print
last_value = cmo.iloc[-1]
tm.log(f"Last value of Chande Momentum Oscillator is {last_value}")
# Plot the values of cmo
tm.plot(cmo, title="Chande Momentum Oscillator", overlay=False)