Draws the average moving average of several moving averages (averageception)
// 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)