RicardoSantos

rs_Chande's Momentum Oscilator - MMA

Chande's Momentum Oscilator, with added MA's for momentum strenght.
สคริปต์โอเพนซอร์ซ

ด้วยจิตวิญญาณของ TradingView อย่างแท้จริง ผู้เขียนสคริปต์นี้ได้เผยแพร่เป็นโอเพนซอร์ส เพื่อให้ผู้ค้าสามารถเข้าใจและตรวจสอบได้ ไชโยให้กับผู้เขียน! คุณสามารถใช้ได้ฟรี แต่การใช้รหัสนี้ซ้ำในสิ่งพิมพ์อยู่ภายใต้กฎระเบียบการใช้งาน คุณสามารถตั้งเป็นรายการโปรดเพื่อใช้บนชาร์ตได้

คำจำกัดสิทธิ์ความรับผิดชอบ

ข้อมูลและบทความไม่ได้มีวัตถุประสงค์เพื่อก่อให้เกิดกิจกรรมทางการเงิน, การลงทุน, การซื้อขาย, ข้อเสนอแนะ หรือคำแนะนำประเภทอื่น ๆ ที่ให้หรือรับรองโดย TradingView อ่านเพิ่มเติมที่ เงื่อนไขการใช้บริการ

ต้องการที่จะใช้สคริปต์นี้บนชาร์ตใช่ไหม?
study(title="[RS]Chande's Momentum Oscilator - MMA", shorttitle="[RS]CMO-MMA")
// 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 :
plot(0, color=black, style=circles)
p1 = plot(hl, color=#9a85b4, style=circles)
p2 = plot(ll, color=#9a85b4, style=circles)
fill(p1,p2, color=#9a85b4, transp=80)

// Chande's MO MA's
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)
// }

ไอเดียที่เกี่ยวข้อง