Strategy vault / Mean reversion
Adaptive Mean Reversion Trading Strategy Based on Chande Momentum Oscillator
The Mean-Reversion Trading Strategy based on the Chande Momentum Oscillator (CMO) is a technical analysis strategy that identifies overbought and oversold zones by calculating price momentum over a specific period…

Overview
The Mean-Reversion Trading Strategy based on the Chande Momentum Oscillator (CMO) is a technical analysis strategy that identifies overbought and oversold zones by calculating price momentum over a specific period. The strategy monitors momentum changes in asset prices and trades when prices show extreme deviations, aiming to capture mean-reversion opportunities. It uses a 9-day CMO indicator as the core signal, entering long positions when CMO falls below -50 and exiting when CMO rises above 50 or the holding period exceeds 5 days.
Strategy Principle
The core of the strategy lies in the calculation and application of the CMO indicator. CMO measures momentum by computing the ratio of the difference between gains and losses to their sum over a specified period. The formula is: CMO = 100 × (Sum of Gains - Sum of Losses)/(Sum of Gains + Sum of Losses)
Unlike traditional RSI, CMO uses both up and down movements in the numerator, providing a more symmetrical momentum measurement. The strategy enters long positions when CMO falls below -50, indicating oversold conditions and expecting price recovery. Positions are closed when CMO rises above 50 or after holding for 5 days.
Strategy Advantages
- Clear Signals - CMO provides definitive overbought and oversold criteria, generating unambiguous trading signals
- Robust Risk Control - Maximum holding period prevents long-term position trapping
- High Adaptability - Parameters can be adjusted for different market conditions
- Solid Theoretical Foundation - Based on well-established mean-reversion theory with academic support
- Simple Calculation - Indicator methodology is straightforward and easy to understand
Strategy Risks
- Trend Market Risk - Mean-reversion strategies may suffer frequent losses in strong trending markets
- Parameter Sensitivity - Strategy performance heavily depends on CMO period and threshold selection
- False Signal Risk - Volatile markets may generate false signals
- Time Risk - Fixed exit timing might miss better profit opportunities
- Slippage Risk - May face significant slippage in low liquidity markets
Optimization Directions
- Trend Filtering - Add long-term trend indicators to trade only with the trend
- Dynamic Parameter Optimization - Adjust CMO period and thresholds based on market volatility
- Enhanced Stop-Loss - Implement dynamic stop-loss to protect profits
- Holding Period Optimization - Dynamically adjust maximum holding time based on volatility
- Volume Confirmation - Incorporate volume indicators to improve signal reliability
Summary
The strategy captures market overbought and oversold opportunities through the CMO indicator, combining fixed-time stop-loss to build a robust mean-reversion trading system. It features clear logic and reasonable risk control with practical value. The strategy's stability and profitability can be further enhanced through parameter optimization and additional auxiliary indicators.
Source Pine Script
/*backtest
start: 2019-12-23 08:00:00
end: 2024-12-09 08:00:00
period: 1d
basePeriod: 1d
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/
//@version=5
strategy("Chande Momentum Oscillator Strategy", overlay=false)
// Input for the CMO period
cmoPeriod = input.int(9, minval=1, title="CMO Period")
// Calculate price changes
priceChange = ta.change(close)
// Separate positive and negative changes
up = priceChange > 0 ? priceChange : 0
down = priceChange < 0 ? -priceChange : 0
// Calculate the sum of ups and downs using a rolling window
sumUp = ta.sma(up, cmoPeriod) * cmoPeriod
sumDown = ta.sma(down, cmoPeriod) * cmoPeriod
// Calculate the Chande Momentum Oscillator (CMO)
cmo = 100 * (sumUp - sumDown) / (sumUp + sumDown)
// Define the entry and exit conditions
buyCondition = cmo < -50
sellCondition1 = cmo > 50
sellCondition2 = ta.barssince(buyCondition) >= 5
// Track if we are in a long position
var bool inTrade = false
if (buyCondition and not inTrade)
strategy.entry("Long", strategy.long)
inTrade := true
if (sellCondition1 or sellCondition2)
strategy.close("Long")
inTrade := false
// Plot the Chande Momentum Oscillator
plot(cmo, title="Chande Momentum Oscillator", color=color.blue)
hline(-50, "Buy Threshold", color=color.green)
hline(50, "Sell Threshold", color=color.red)
Published by ChaoZhang on the FMZ strategy square · last modified 2024-12-11. Collected in the Quant Trading Vault. Unvalidated research: re-test with your own data and costs before trusting it.
Build this with AgenKit
A spec is not a trading system. Paste this into your coding agent and AgenKit runs a specialist team — architecture, test-first build, risk gates, review — with paper trading on by default.
/agenkit build a production-grade trading bot with a backtest engine, risk controls and paper trading by default from strategies/Adaptive-Mean-Reversion-Trading-Strategy-Based-on-Chande-Momentum-Oscillator.md- npx agenkit install engineering-kit in your project
- Paste the command into your agent and approve each phase
- Get tests, backtest, risk controls and a paper-trading switch
Understand it first
Before you run this, read the lesson behind the idea and how to backtest it honestly. Specs like this one are the survivors of an unknown number of trials; deflate their results accordingly.
Related specs
- Advanced Momentum EMA Trend Following with RSI Overbought Oversold Trading StrategyPine Script · Mean reversion · 1d
- Advanced Strategy with Volume and Price Pullback Multiple Take ProfitPine Script · Mean reversion · 1h
- Dynamic Adaptive Multi Timeframe Trend Following and Range Reversal Hybrid StrategyPine Script · Mean reversion · 2d
- Fast RSI Reversal Trading StrategyPine Script · Mean reversion · 1h
- Multi Indicator Reversal Point Capture Trading StrategyPine Script · Mean reversion · 1d
- Multi Timeframe Adaptive Mean Reversion with Volume Analysis StrategyPine Script · Mean reversion · 1h