# [RS]Chande&#039;s Momentum Oscilator - MMA - Candles V0

233 0
update to old script: using candles to plot multiple moving averages increases readability.
```study(title="[RS]Chande's Momentum Oscilator - MMA - Candles V0", shorttitle="[RS]CMO-MMAC")
// Notes : {
// @author : RicardoSantos
// Chande's Momentum Oscilator:
//
// ((Su - Sd) / (Su + Sd)) * 100
//
//      - Su is the sum of the momentum of up days in the period under analysis
//      - Sd is the sum of the momentum of down days in the period under analysis.
//      - The default period is the last 9 days.
// }

// Input : {
p = input(24, title="Period:")
hl = input(40, title="Overbought:")
ll = input(-40, title="Oversold:")
// }

// Function : {
s = close
Su = sma(close > open ? s - s[1] : 0, p)
Sd = sma(close < open ? abs(s - s[1]) : 0, p)

cmo = ((Su - Sd)/(Su + Sd))*100
ma1 = ema(cmo, 12)
ma2 = ema(ma1, 24)
ma3 = ema(ma2, 48)
// }

// Output : {
// Color Switches :
c0 = cmo > ma1 ? #337e33 : #B44949
c1 = ma1 > cmo ? #bc5a5a : #42a242
c2 = ma2 > cmo ? #a24242 : #5abc5a
c3 = ma3 > cmo ? #7e3333 : #7fcb7f

// Lines :
hline(0, color=black)
p1 = hline(hl, color=#9a85b4)
p2 = hline(ll, color=#9a85b4)
fill(p1,p2, color=#9a85b4, transp=80)

// Chande's MO MA's
plotcandle(ma3, max(ma1,cmo), min(ma1, cmo), ma2, color=ma2>=ma3?green:maroon)
plot(cmo, color=c0, style=line, linewidth=2)
//plot(ma1, color=c1, style=circles, linewidth=2, join=true)
//plot(ma2, color=c2, style=circles, linewidth=2, join=true)
//plot(ma3, color=c3, style=circles, linewidth=2, join=true)
// }```

## Related Ideas

EN English
EN English (UK)
EN English (IN)
DE Deutsch
FR Français
ES Español
IT Italiano
PL Polski
SV Svenska
TR Türkçe
RU Русский
PT Português
ID Bahasa Indonesia
MS Bahasa Melayu
TH ภาษาไทย
VI Tiếng Việt
JA 日本語
KO 한국어
ZH 简体中文
ZH 繁體中文
AR العربية
Home Stock Screener Forex Signal Finder Cryptocurrency Signal Finder Economic Calendar How It Works Chart Features House Rules Moderators Website & Broker Solutions Widgets Stock Charting Library Feature Request Blog & News FAQ Help & Wiki Twitter