Returns the Chande momentum oscillator: the sum of up moves minus the sum of down moves, as a percentage of their total.
ta.cmo sums the positive bar-to-bar changes of the series and, separately, the size of the negative ones over length bars. It returns 100 * (up - down) / (up + down).
The result runs from -100 (every move was down) to +100 (every move was up). It appears on bar number length + 1.
Syntax
ta.cmo(series: series int/float, length: series int) -> series floatArguments
| Name | Type | Default | Description |
|---|---|---|---|
| series | series int/ | required | Series whose changes are summed. |
| length | series int | required | Number of bars in the sums. A whole number of 1 or more. |
Returns
series float: a value from -100 to 100, or na while the window is not full.
Remarks
- Unlike
ta.rsi, the sums are not smoothed recursively, so the output depends only on the last length bars.
Example
//@version=6
indicator("CMO")
value = ta.cmo(close, 9)
plot(value, "CMO", color = value >= 0 ? color.green : color.red)
hline(50)
hline(-50)See also
Runs on Sidechair