ta.cmo()
Chande Momentum Oscillator
Calculates the difference between the sum of recent gains and the sum of recent losses and then divides the result by the sum of all price movement over the same period.
Syntax
ta.cmo(series, length) → series floatArguments
| Parameter | Type | Description |
|---|---|---|
| series | series int/float | Source series for momentum measurement. |
| length | series int | Lookback length for summing up/down moves. |
Returns
Chande Momentum Oscillator.
Remarks
na values in the source series are ignored.
Code Examples
//@version=6
indicator("ta.cmo")
plot(ta.cmo(close, 5), color=color.yellow)
// the same on pine
f_cmo(src, length) =>
float mom = ta.change(src)
float sm1 = math.sum((mom >= 0) ? mom : 0.0, length)
float sm2 = math.sum((mom >= 0) ? 0.0 : -mom, length)
100 * (sm1 - sm2) / (sm1 + sm2)
plot(f_cmo(close, 5))Trading Applications
Measure momentum strength on a -100 to +100 scale
Identify overbought/oversold extremes
Detect momentum divergences
Use as a filter for trend-following strategies
Frequently Asked Questions
Generate ta.cmo() Code with AI
Skip the manual coding. Use Pineify's AI Coding Agent to generate Pine Script code using ta.cmo() and other built-in functions instantly.
Related Pine Script Functions
ta.rsi() - Relative Strength Index
Learn how to use ta.rsi() in Pine Script. Syntax, parameters, code examples for the RSI momentum oscillator.
ta.stoch() - Stochastic Oscillator
Learn how to use ta.stoch() in Pine Script. Syntax, parameters, code examples for the Stochastic Oscillator.
ta.cci() - Commodity Channel Index
Learn how to use ta.cci() in Pine Script. Syntax, parameters, code examples for the CCI momentum indicator.
ta.mom() - Momentum
Learn how to use ta.mom() in Pine Script. Syntax, parameters, code examples for the Momentum indicator.
ta.tsi() - True Strength Index
Learn how to use ta.tsi() in Pine Script. Syntax, parameters, code examples for the double-smoothed TSI indicator.