Chande Momentum Oscillator Pine Script — Complete TradingView Guide
The Chande Momentum Oscillator (CMO) Pine Script implementation uses the built-in ta.cmo(source, length) function to measure raw price momentum on a scale of −100 to +100. Developed by Tushar Chande in 1994, the CMO quantifies the difference between the sum of gains and the sum of losses over a lookback period, with no smoothing applied — making it more reactive than RSI or Stochastic. Positive readings signal bullish momentum, negative readings signal bearish momentum, and the zero line acts as the key trend boundary. The CMO works on stocks, crypto, forex, and futures across all timeframes from 1-minute scalping to weekly position trading. This guide covers the complete Pine Script v6 code, all configurable parameters, three concrete trading strategies with numbered entry conditions, and step-by-step instructions for generating CMO scripts instantly with Pineify.
What Is the Chande Momentum Oscillator?
The Chande Momentum Oscillator (CMO) is a momentum indicator that measures the net difference between up-day price moves and down-day price moves, divided by the total of all moves, used to identify overbought, oversold, and trend-reversal conditions. It was developed by Tushar Chande and first published in 1994 in his book The New Technical Trader, co-authored with Stanley Kroll. Unlike RSI, which applies Wilder's exponential smoothing, the CMO uses raw sums — meaning it captures momentum shifts earlier but with more short-term noise.
Formula: CMO = 100 × (Su − Sd) / (Su + Sd), where Su is the sum of all up-day price changes over the period and Sd is the sum of all down-day price changes over the same period. An up-day is any bar where the close is higher than the previous close; a down-day is any bar where the close is lower. The result oscillates between −100 (all down-days) and +100 (all up-days).
In Pine Script v6, the function ta.cmo(source, length) handles this calculation automatically. The source parameter accepts any numeric series (most commonly close), and length defines how many bars to include in the rolling window. The default used in Pineify's implementation is 9 bars, suitable for fast intraday signals.
The CMO is applicable across all major asset classes: stocks, cryptocurrency, forex, and futures. It is particularly effective on assets with sharp, decisive momentum moves — cryptocurrency pairs (BTC/USD, ETH/USD) and forex majors (EUR/USD, USD/JPY) respond well because of their clear directional phases. For stocks, the CMO works best on individual equities rather than broad indices due to their higher momentum tendency.
The best timeframes for the CMO span a wide range: the 15-minute to 1-hour chart for active day traders using length 9–14, the 4-hour or daily chart for swing traders using length 14–20, and the weekly chart for position traders using length 20–25. On very short timeframes (1m–5m), the unsmoothed nature of the CMO can generate too many false signals — in this case, adding a signal line (a moving average of the CMO) helps filter noise.
Best Markets
Stocks · Crypto · Forex · Futures
Best Timeframes
15m, 1H, 4H, Daily
Oscillator Range
−100 to +100 (no panel overlay)
Chande Momentum Oscillator Pine Script Code
The script below plots the 9-period CMO in a separate panel below the price chart, with a dashed zero line for reference. To use it, copy the code, open the TradingView Pine Script editor with Alt+P, paste it in, and click Add to chart. You can change the 9 in ta.cmo(close, 9) to any lookback period to match your trading style.
// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © Pineify
//@version=6
indicator(title="Chande Momentum Oscillator", overlay=false, max_labels_count=500)
// CMO: measures raw momentum — positive values indicate bullish momentum
p_ind_1 = ta.cmo(close, 9) // CMO with 9-bar period
// Plot the CMO line and zero reference
plot(p_ind_1, "CMO", color.rgb(41, 98, 255, 0), 1)
hline(0, color=#787B86, linestyle=hline.style_dashed, title="CMO - Zero Line")Chart Preview

Parameters
| Parameter | Default Value | Description | Recommended Range |
|---|---|---|---|
| source | close | The price series to measure momentum on. Typically close; can also use hlc3 for a smoother reading. | Any numeric series |
| length | 9 | Number of bars in the lookback window. Controls sensitivity — lower values react faster but produce more noise; higher values are smoother but slower. | 7–25 (most common: 9, 14, 20) |
Tuning Guide by Trading Style
- Scalping (1m–15m charts): length 7–9 — fast CMO signals, use with zero-line crossovers only
- Day trading (1H–4H charts): length 9–14 — balances speed and reliability; mirrors RSI-14 for comparison
- Swing trading (Daily charts): length 14–20 — Chande's original recommendation for daily bars
- Position trading (Weekly charts): length 20–25 — reduces noise; confirms major momentum shifts
Trading Strategies Using the Chande Momentum Oscillator
The CMO generates its strongest signals through zero-line crossovers, overbought/oversold reversals, and price divergence. Below are three concrete strategies with specific numbered entry and exit conditions.
Strategy 1 — CMO Zero-Line Crossover with EMA Trend Filter
Market environment: trending markets · Best timeframe: 1H, 4H
The zero-line crossover identifies when momentum shifts direction. Pairing ta.cmo(close, 9) with a 200-period EMA keeps trades aligned with the primary trend, reducing false crossovers.
- Calculate CMO(9):
cmo = ta.cmo(close, 9) - Calculate EMA(200) as trend filter:
ema200 = ta.ema(close, 200) - Long entry: CMO crosses above 0 AND close > ema200
- Short entry: CMO crosses below 0 AND close < ema200
- Exit: CMO crosses back through zero in the opposite direction
Strategy 2 — CMO Overbought/Oversold Reversal with Bollinger Bands
Market environment: ranging markets · Best timeframe: 4H, Daily
In ranging conditions, extreme CMO readings (+50/−50) signal exhaustion. Confirming with Bollinger Bands price touching the upper/lower band increases signal reliability.
- Calculate CMO(14):
cmo = ta.cmo(close, 14) - Calculate Bollinger Bands (20, 2.0):
[bb_mid, bb_upper, bb_lower] = ta.bb(close, 20, 2.0) - Long entry: CMO < −50 AND close <= bb_lower (oversold + lower band touch)
- Short entry: CMO > +50 AND close >= bb_upper (overbought + upper band touch)
- Exit: CMO returns to the 0 line or price returns to the Bollinger Band midline
Strategy 3 — CMO Divergence with RSI Confirmation
Market environment: topping / bottoming patterns · Best timeframe: 4H, Daily
CMO divergence, confirmed by RSI divergence in the same direction, provides high-confidence reversal signals. Requiring both oscillators to diverge simultaneously filters out single-indicator false signals.
- Calculate CMO(9) and RSI(14):
cmo = ta.cmo(close, 9)andrsi = ta.rsi(close, 14) - Identify the last two swing highs/lows in price and in both oscillators
- Bullish divergence entry: price makes lower low AND CMO makes higher low AND RSI makes higher low
- Bearish divergence entry: price makes higher high AND CMO makes lower high AND RSI makes lower high
- Stop loss: below/above the recent swing low/high; target 2:1 risk-reward ratio
Disclaimer: The strategies above are for educational purposes only and do not constitute investment advice. Past performance does not guarantee future results. Always apply proper risk management and position sizing.
How to Generate the CMO Indicator in Pineify
- 1
Open Pineify
Go to pineify.app and sign in — a free account gives you full access to the AI Coding Agent.
- 2
Click "New Indicator"
Select "Indicator" as the script type from the creation menu to start a new Pine Script project.
- 3
Describe your CMO configuration
Type a prompt such as: "Plot the Chande Momentum Oscillator with a 9-bar period on close, show a zero line, and add overbought/oversold lines at +50 and −50." Pineify's AI generates the complete Pine Script v6 code in seconds.
- 4
Copy the generated code to TradingView
Click "Copy to TradingView" in Pineify, then open the TradingView Pine Script editor (Alt+P), paste the code, and click "Add to chart" to see the CMO plotted immediately.
- 5
Adjust the period and thresholds
In the TradingView indicator settings panel, change the length parameter (try 14 for day trading or 20 for swing trading) and the overbought/oversold threshold levels without editing any code.
Frequently Asked Questions
Related Pine Script Indicators
Build Your CMO Indicator in Seconds
Skip the manual coding. Pineify's AI Coding Agent generates complete, ready-to-use Pine Script indicators — including custom CMO strategies with divergence detection and signal filters — instantly for free.
Try Pineify Free