117 0 15
moving average system which can indicate the best buy             or sell point
Remove from Favorite Scripts Add to Favorite Scripts
study(title="Moving Average System",shorttitle="MAS",overlay=true)

// Inputs
legs = input(defval=3)
legm = input(defval=9)
legl = input(defval=18)

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)
wmam = wwma(legm,close)
wmal = wwma(legl,close)

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

// Plots

plot(sd and x ? wmas : na,style=circles, linewidth=6, color=black)
plot(sd and y ? wmam : na,style=cross, linewidth=6, color=#F9F900)
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
Profile Profile Settings Account and Billing My Support Tickets Contact Support Ideas Published Followers Following Private Messages Chat Sign Out