lnostdal

MA of MAs [nostdal.duckdns.org]

Draws the average moving average of several moving averages (averageception)
Remove from Favorite Scripts Add to Favorite Scripts
// Modifications of ChrisMoody's "CM_Ultimate_MA_MTF" script
// Draws the average moving average of several moving averages (averageception)

study(title="MA of MAs [nostdal.duckdns.org]", shorttitle="MA of MAs [nostdal.duckdns.org]", overlay=true)

// Inputs
src = close
useCurrentRes = input(true, title="Use Current Chart Resolution?")
resCustom = input(title="Use Different Timeframe? Uncheck Box Above", type=resolution, defval="D")
len = input(20, title="Moving Average Length - LookBack Period")
cc = input(true, title="Change Color Based On Direction?")
smoothe = input(2, minval=1, maxval=10, title="Color Smoothing - 1 = No Smoothing")


res = useCurrentRes ? period : resCustom

hullma = wma(2 * wma(src, len / 2) - wma(src, len), round(sqrt(len)))

ema1 = ema(src, len)
ema2 = ema(ema1, len)
ema3 = ema(ema2, len)
tema = 3 * (ema1 - ema2) + ema3

avg = (sma(src, len) + ema(src, len) + wma(src, len) + hullma + vwma(src, len) + rma(src, len)) / 6


out = security(tickerid, res, avg)
ma_up = out >= out[smoothe]
ma_down = out < out[smoothe]
col = cc ? ma_up ? #006600 : ma_down ? #660000 : aqua : aqua
plot(out, title="MA of MAs", style=line, linewidth=4, color = col)
Ideas Scripts Chart
United States
United Kingdom
India
España
France
Italia
Polska
Brasil
Россия
Türkiye
日本
한국
Home Stock Screener Forex Signal Finder Economic Calendar How It Works Chart Features House Rules Moderators For the WEB Widgets Stock Charting Library Priority Support Feature Request Blog & News FAQ Help & Wiki Twitter
Private Messages Chat Ideas Published Followers Following Priority Support Public Profile Profile Settings Account and Billing Sign Out