Chande Momentum Oscillator
CMO measures the difference between the sum of positive and negative price changes.
Method
tm.ta.cmo(source, timeperiod)
Inputs
Parameter | Argument type | Description | Default Value |
---|---|---|---|
source | pd.Series | Input data series | - |
timeperiod | int | Number of periods for the indicator | 14 |
Outputs
Output | Type |
---|---|
cmo | np.ndarray |
Example usage
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)