sb123mop

HC-MAS

49 0 4
useless indicator
Remove from Favorite Scripts Add to Favorite Scripts
study(title="Moving Average System",shorttitle="MAS",overlay=true)

// Inputs
legs = input(defval=5)
legl = input(defval=10)

sd = input(true, title="Show dots?")
ccol = input(true,title="Change Color?")

// Calc
wwma(l,p) =>
    wwma = (nz(wwma[1]) * (l - 1) + p) / l
    
wmas = wwma(legs,close)
wmal = wwma(legl,close)


// Styling
cols = ccol ?( wmas > wmas[1] ? #D26900: #28FF28) : #D26900
coll = ccol ?( wmal > wmal[1] ? #D26900F : #28FF28) : #D26900
x = cross(wmas,wmal)


// Plots
p1 = plot(wmas,linewidth=1,color=cols)
p2 = plot(wmal,linewidth=1,color=coll)
fill(p1, p2, color = black)

plot(sd and x and wmas > wmas[1] ? wmas : na,style=circles, linewidth=8, color=black)
plot(sd and x and wmas < wmas[1] ? wmal : na,style=cross, linewidth=6, color=purple)
English
English (UK)
English (IN)
Deutsch
Français
Español
Italiano
Polski
Türkçe
Русский
Português
Bahasa Indonesia
Bahasa Melayu
ภาษาไทย
Tiếng Việt
日本語
한국어
简体
台灣
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
Profile Profile Settings Account and Billing My Support Tickets Contact Support Ideas Published Followers Following Private Messages Chat Sign Out