OPEN-SOURCE SCRIPT
Atualizado Chande Momentum Oscillator - CMO | TR

🎯 Overview
Chande Momentum Oscillator - CMO | TR is a powerful momentum indicator developed by Tushar Chande that measures the difference between the sum of recent gains and the sum of recent losses, normalized to a range between -100 and +100. Developed by Tiagorocha1989, this enhanced version offers dual-mode operation with moving average customization and comprehensive visual features, helping traders identify overbought and oversold conditions, momentum shifts, and potential reversal points with clarity and precision.
🔧 How It Works
The Chande Momentum Oscillator (CMO) is closely related to the Relative Strength Index (RSI) but uses a different calculation method that makes it more responsive to price movements. While RSI focuses on the ratio of average gains to average losses, CMO uses the difference between the sums of gains and losses over the period.
Core Calculation Logic:
The CMO calculation follows these steps:
Price Change: For each period, calculate the price change (current price minus previous price)
Sum of Gains: Add all positive price changes over the specified period
Sum of Losses: Add all negative price changes over the specified period (as absolute values)
CMO Formula: CMO = 100 × (Sum of Gains - Sum of Losses) / (Sum of Gains + Sum of Losses)
The resulting oscillator oscillates between -100 and +100, with:
Positive values indicating that gains exceed losses (bullish momentum)
Negative values indicating that losses exceed gains (bearish momentum)
Zero line representing equilibrium between gains and losses
Readings above +50 suggesting strong bullish momentum (potential overbought conditions)
Readings below -50 suggesting strong bearish momentum (potential oversold conditions)
The indicator compares CMO to a reference line that can be either:
The traditional zero level
A user-defined moving average of CMO itself (CMO MA mode)
✨ Key Features
🔹 Dual Operating Modes
Zero Line Mode: Classic CMO implementation where signals occur when CMO crosses above or below the zero line, indicating momentum shifts
CMO MA Mode: Enhanced version where signals occur when CMO crosses its own moving average, providing smoother, filtered entries
🔹 Flexible Moving Average Selection
Choose from six MA types for the CMO MA mode:
EMA (Exponential Moving Average) for responsive signals
SMA (Simple Moving Average) for smoother readings
RMA (Rolling Moving Average) for weighted recent data
WMA (Weighted Moving Average) for customizable weighting
VWMA (Volume-Weighted Moving Average) incorporating volume
HMA (Hull Moving Average) for reduced lag
🔹 Customizable CMO Parameters
Length CMO: Lookback period for CMO calculation (default 14)
Source CMO: Price source for calculations (default Close)
🔹 Customizable Color Themes
Eight distinct color schemes to match your charting preferences:
Classic – Green for bullish, Red for bearish
Modern – White for bullish, Purple for bearish
Robust – Amber for bullish, Maroon for bearish
Accented – Violet for bullish, Pink for bearish
Monochrome – Light gray for bullish, Dark gray for bearish
Moderate – Green for bullish, Red for bearish
Aqua – Blue for bullish, Orange for bearish
Cosmic – Pink for bullish, Purple for bearish
🔹 Comprehensive Visual Feedback
Colored CMO Line: Changes color based on position relative to the reference line
Reference Line: Yellow line showing either zero or the moving average of CMO
Gradient Fill Zones: Clear visualization of extreme momentum readings at +/-50 levels
Dynamic Zone Fills: Semi-transparent fills showing when CMO is above or below the reference line
Color-Coded Candles: Bars reflect current CMO bias (above or below reference)
Signal Markers: Triangle up/down symbols at crossover points
Live Value Display: Current CMO value shown in a floating label
Trend Table: Bullish/Bearish status displayed on the chart
🔹 Ready-to-Use Alerts
Built-in alert conditions trigger LONG signals on bullish crossovers and SHORT signals on bearish crossunders across both operating modes.
⚙️ Settings Summary
Color Choice: Select from eight visual themes (Default: Classic)
Length CMO: Lookback period for CMO calculation (Default: 14)
Source CMO: Price source for calculations (Default: Close)
Entry/Exit Signal: Choose between zero line or CMO MA mode (Default: Zero Line)
Length MA: Moving average period for CMO MA mode (Default: 365)
CMO MA Type: Moving average method for signal line (Default: EMA)
📈 Practical Applications
🔹 Overbought/Oversold Detection
Traditional CMO usage identifies extreme conditions:
Readings above +50 suggest strong bullish momentum, potentially overbought
Readings below -50 suggest strong bearish momentum, potentially oversold
The indicator provides gradient fills at these levels for visual clarity
Unlike RSI, CMO's symmetric range (-100 to +100) provides balanced overbought/oversold zones
🔹 Zero Line Crossovers
In Zero Line mode, crossovers provide momentum signals:
Crossover above zero → Bullish momentum strengthening
Crossunder below zero → Bearish momentum strengthening
These signals often lead RSI centerline crossovers due to CMO's responsiveness
🔹 Signal Line Crossovers
In CMO MA mode, crossovers between CMO and its moving average provide filtered signals that reduce whipsaws in choppy markets while maintaining sensitivity in trends.
🔹 Divergence Trading
CMO is excellent for spotting divergences:
Bullish Divergence: Price makes lower low, CMO makes higher low → Potential upside reversal
Bearish Divergence: Price makes higher high, CMO makes lower high → Potential downside reversal
Divergences are most significant when occurring at extreme levels (above +50 or below -50)
🔹 Momentum Confirmation
The slope and magnitude of CMO confirm trend strength:
Rising CMO values → Strengthening bullish momentum
Falling CMO values → Strengthening bearish momentum
Flattening CMO → Momentum slowing, potential trend change
🔹 Centerline Rejections
When CMO approaches zero but reverses before crossing, it can signal trend continuation:
CMO pulls back toward zero but reverses up → Bullish continuation
CMO rallies toward zero but reverses down → Bearish continuation
🔹 Multiple Timeframe Analysis
Compare CMO readings across different timeframes:
Higher timeframe CMO confirms primary trend direction
Lower timeframe CMO identifies entry timing and short-term momentum shifts
🎯 Ideal For
✅ Momentum Traders seeking a responsive yet reliable momentum oscillator
✅ Mean Reversion Traders looking for overbought and oversold opportunities
✅ Divergence Traders wanting early reversal signals
✅ Swing Traders capturing medium-term momentum shifts
✅ System Developers needing a symmetric, bounded momentum indicator
✅ Traders familiar with RSI seeking a more responsive alternative
📌 Key Takeaways
Symmetric Range: CMO oscillates between -100 and +100, providing balanced overbought/oversold zones at +/-50
Responsive Design: CMO is typically more responsive than RSI due to its calculation method, making it excellent for early signal detection
Dual-Mode Flexibility: Choose between classic zero-line crossovers for simplicity or MA-smoothed signals for filtered entries
Comprehensive Visualization: Color themes, gradient fills for extreme readings, candles, and labels provide immediate market awareness
Divergence Capability: Excellent for spotting both regular and hidden divergences
Alert-Ready: Built-in alerts for both LONG and SHORT signals across both operating modes
⚠️ Important Notes
CMO's increased responsiveness can lead to more frequent signals, which may require additional filtering in ranging markets. The default length of 14 provides a balance between sensitivity and reliability; shorter lengths increase responsiveness but may increase false signals. The 365-day MA default in CMO MA mode is designed for longer-term trend context on daily charts. The +/-50 levels are guidelines, not strict rules; in strong trends, CMO can remain above +50 or below -50 for extended periods. Divergences are most reliable when they occur at extreme readings. Always combine with proper risk management and additional confirmation for best results.
Disclaimer: This indicator is provided for educational and informational purposes only. Past performance is not indicative of future results. Always conduct thorough testing and align with your risk management strategy before live deployment.
Chande Momentum Oscillator - CMO | TR is a powerful momentum indicator developed by Tushar Chande that measures the difference between the sum of recent gains and the sum of recent losses, normalized to a range between -100 and +100. Developed by Tiagorocha1989, this enhanced version offers dual-mode operation with moving average customization and comprehensive visual features, helping traders identify overbought and oversold conditions, momentum shifts, and potential reversal points with clarity and precision.
🔧 How It Works
The Chande Momentum Oscillator (CMO) is closely related to the Relative Strength Index (RSI) but uses a different calculation method that makes it more responsive to price movements. While RSI focuses on the ratio of average gains to average losses, CMO uses the difference between the sums of gains and losses over the period.
Core Calculation Logic:
The CMO calculation follows these steps:
Price Change: For each period, calculate the price change (current price minus previous price)
Sum of Gains: Add all positive price changes over the specified period
Sum of Losses: Add all negative price changes over the specified period (as absolute values)
CMO Formula: CMO = 100 × (Sum of Gains - Sum of Losses) / (Sum of Gains + Sum of Losses)
The resulting oscillator oscillates between -100 and +100, with:
Positive values indicating that gains exceed losses (bullish momentum)
Negative values indicating that losses exceed gains (bearish momentum)
Zero line representing equilibrium between gains and losses
Readings above +50 suggesting strong bullish momentum (potential overbought conditions)
Readings below -50 suggesting strong bearish momentum (potential oversold conditions)
The indicator compares CMO to a reference line that can be either:
The traditional zero level
A user-defined moving average of CMO itself (CMO MA mode)
✨ Key Features
🔹 Dual Operating Modes
Zero Line Mode: Classic CMO implementation where signals occur when CMO crosses above or below the zero line, indicating momentum shifts
CMO MA Mode: Enhanced version where signals occur when CMO crosses its own moving average, providing smoother, filtered entries
🔹 Flexible Moving Average Selection
Choose from six MA types for the CMO MA mode:
EMA (Exponential Moving Average) for responsive signals
SMA (Simple Moving Average) for smoother readings
RMA (Rolling Moving Average) for weighted recent data
WMA (Weighted Moving Average) for customizable weighting
VWMA (Volume-Weighted Moving Average) incorporating volume
HMA (Hull Moving Average) for reduced lag
🔹 Customizable CMO Parameters
Length CMO: Lookback period for CMO calculation (default 14)
Source CMO: Price source for calculations (default Close)
🔹 Customizable Color Themes
Eight distinct color schemes to match your charting preferences:
Classic – Green for bullish, Red for bearish
Modern – White for bullish, Purple for bearish
Robust – Amber for bullish, Maroon for bearish
Accented – Violet for bullish, Pink for bearish
Monochrome – Light gray for bullish, Dark gray for bearish
Moderate – Green for bullish, Red for bearish
Aqua – Blue for bullish, Orange for bearish
Cosmic – Pink for bullish, Purple for bearish
🔹 Comprehensive Visual Feedback
Colored CMO Line: Changes color based on position relative to the reference line
Reference Line: Yellow line showing either zero or the moving average of CMO
Gradient Fill Zones: Clear visualization of extreme momentum readings at +/-50 levels
Dynamic Zone Fills: Semi-transparent fills showing when CMO is above or below the reference line
Color-Coded Candles: Bars reflect current CMO bias (above or below reference)
Signal Markers: Triangle up/down symbols at crossover points
Live Value Display: Current CMO value shown in a floating label
Trend Table: Bullish/Bearish status displayed on the chart
🔹 Ready-to-Use Alerts
Built-in alert conditions trigger LONG signals on bullish crossovers and SHORT signals on bearish crossunders across both operating modes.
⚙️ Settings Summary
Color Choice: Select from eight visual themes (Default: Classic)
Length CMO: Lookback period for CMO calculation (Default: 14)
Source CMO: Price source for calculations (Default: Close)
Entry/Exit Signal: Choose between zero line or CMO MA mode (Default: Zero Line)
Length MA: Moving average period for CMO MA mode (Default: 365)
CMO MA Type: Moving average method for signal line (Default: EMA)
📈 Practical Applications
🔹 Overbought/Oversold Detection
Traditional CMO usage identifies extreme conditions:
Readings above +50 suggest strong bullish momentum, potentially overbought
Readings below -50 suggest strong bearish momentum, potentially oversold
The indicator provides gradient fills at these levels for visual clarity
Unlike RSI, CMO's symmetric range (-100 to +100) provides balanced overbought/oversold zones
🔹 Zero Line Crossovers
In Zero Line mode, crossovers provide momentum signals:
Crossover above zero → Bullish momentum strengthening
Crossunder below zero → Bearish momentum strengthening
These signals often lead RSI centerline crossovers due to CMO's responsiveness
🔹 Signal Line Crossovers
In CMO MA mode, crossovers between CMO and its moving average provide filtered signals that reduce whipsaws in choppy markets while maintaining sensitivity in trends.
🔹 Divergence Trading
CMO is excellent for spotting divergences:
Bullish Divergence: Price makes lower low, CMO makes higher low → Potential upside reversal
Bearish Divergence: Price makes higher high, CMO makes lower high → Potential downside reversal
Divergences are most significant when occurring at extreme levels (above +50 or below -50)
🔹 Momentum Confirmation
The slope and magnitude of CMO confirm trend strength:
Rising CMO values → Strengthening bullish momentum
Falling CMO values → Strengthening bearish momentum
Flattening CMO → Momentum slowing, potential trend change
🔹 Centerline Rejections
When CMO approaches zero but reverses before crossing, it can signal trend continuation:
CMO pulls back toward zero but reverses up → Bullish continuation
CMO rallies toward zero but reverses down → Bearish continuation
🔹 Multiple Timeframe Analysis
Compare CMO readings across different timeframes:
Higher timeframe CMO confirms primary trend direction
Lower timeframe CMO identifies entry timing and short-term momentum shifts
🎯 Ideal For
✅ Momentum Traders seeking a responsive yet reliable momentum oscillator
✅ Mean Reversion Traders looking for overbought and oversold opportunities
✅ Divergence Traders wanting early reversal signals
✅ Swing Traders capturing medium-term momentum shifts
✅ System Developers needing a symmetric, bounded momentum indicator
✅ Traders familiar with RSI seeking a more responsive alternative
📌 Key Takeaways
Symmetric Range: CMO oscillates between -100 and +100, providing balanced overbought/oversold zones at +/-50
Responsive Design: CMO is typically more responsive than RSI due to its calculation method, making it excellent for early signal detection
Dual-Mode Flexibility: Choose between classic zero-line crossovers for simplicity or MA-smoothed signals for filtered entries
Comprehensive Visualization: Color themes, gradient fills for extreme readings, candles, and labels provide immediate market awareness
Divergence Capability: Excellent for spotting both regular and hidden divergences
Alert-Ready: Built-in alerts for both LONG and SHORT signals across both operating modes
⚠️ Important Notes
CMO's increased responsiveness can lead to more frequent signals, which may require additional filtering in ranging markets. The default length of 14 provides a balance between sensitivity and reliability; shorter lengths increase responsiveness but may increase false signals. The 365-day MA default in CMO MA mode is designed for longer-term trend context on daily charts. The +/-50 levels are guidelines, not strict rules; in strong trends, CMO can remain above +50 or below -50 for extended periods. Divergences are most reliable when they occur at extreme readings. Always combine with proper risk management and additional confirmation for best results.
Disclaimer: This indicator is provided for educational and informational purposes only. Past performance is not indicative of future results. Always conduct thorough testing and align with your risk management strategy before live deployment.
Notas de Lançamento
Resolution Previous ProblemNotas de Lançamento
Color Mode – Added 'Heat' option ([#ff0000, #87cefb]).Dynamic Fill Transparency – Calculates Momentum and Norm_Momentum to set a variable transparency (Fill_Transp) for the overbought/oversold fills, replacing the fixed 0/100 values.
Gradient Candle Colors – Computes a normalized and uses color.from_gradient() to color candles with a smooth transition between down and up colors.
Persistent Trend State – Introduces Trend_ (1 for bull, -1 for bear) that holds the trend direction, used in:
The third fill() (now based on Trend_ instead of a direct.
bgcolor() (now uses Trend_ instead of isBull_/isBear_).
The table and label (display and color based on Trend_).
Label Color – Simplified to use Trend_ colors without transparency.
Notas de Lançamento
.Script de código aberto
Em verdadeiro espírito do TradingView, o criador deste script o tornou de código aberto, para que os traders possam revisar e verificar sua funcionalidade. Parabéns ao autor! Embora você possa usá-lo gratuitamente, lembre-se de que a republicação do código está sujeita às nossas Regras da Casa.
Aviso legal
As informações e publicações não se destinam a ser, e não constituem, conselhos ou recomendações financeiras, de investimento, comerciais ou de outro tipo fornecidos ou endossados pela TradingView. Leia mais nos Termos de Uso.
Script de código aberto
Em verdadeiro espírito do TradingView, o criador deste script o tornou de código aberto, para que os traders possam revisar e verificar sua funcionalidade. Parabéns ao autor! Embora você possa usá-lo gratuitamente, lembre-se de que a republicação do código está sujeita às nossas Regras da Casa.
Aviso legal
As informações e publicações não se destinam a ser, e não constituem, conselhos ou recomendações financeiras, de investimento, comerciais ou de outro tipo fornecidos ou endossados pela TradingView. Leia mais nos Termos de Uso.