ta.cmo
Measure momentum from the balance of up and down moves, on a -100 to 100 scale.
ta.cmo(source, length)Chande Momentum Oscillator: 100 * (sum of upward changes - sum of downward changes) / (sum of both), over the last length one-bar changes. These are plain rolling sums, not Wilder smoothing, which is what separates it from ta.rsi. Bounded to [-100, 100].
Parameters
A series parameter takes a value on every bar. A constant parameter must be known before the first bar, such as a number or an input.
| Name | Kind | Type | Default | Range | Description |
|---|---|---|---|---|---|
source | Series | number | - | - | The series to read. |
length | Constant | number | 9 | 1 to 10000 | Window in observed bars. |
Output
| Name | Type |
|---|---|
value | number |
Warm-up and missing values
- Warm-up
length + 1bars. Names in the warm-up are this operator’s parameters.- Missing values
- Returns na until
lengthconsecutive one-bar changes are in the window (so length + 1 observations). An na resets the accumulation. na when the window has no movement at all, up or down, because the index is 0/0 there.
Example
ta.cmo(close, 9)plot(ta.cmo(close, 9), "Momentum oscillator 9")