This is a 3 time frame weighted moving average. It can help guide trades on a smaller time frame by showing larger timeframe trend.
study("WMAMulti", overlay=true) tf1 = input(title="time frame 1", defval="15") tf2 = input(title="time frame 2", defval="30") tf3 = input(title="time frame 3", defval="60") length = input(title="length", defval=20) ma1 = security(tickerid, tf1, wma(hl2, length)) ma2 = security(tickerid, tf2, wma(hl2, length)) ma3 = security(tickerid, tf3, wma(hl2, length)) getcolor (avg, tf) => prev = security(tickerid, tf, wma(hl2, length)[1]) avg >= prev ? green : red plot(ma3, color=getcolor(ma3, tf3), style=line, linewidth=3) plot(ma2, color=getcolor(ma2, tf2), style=line, linewidth=3) plot(ma1, color=getcolor(ma1, tf1), style=line, linewidth=3)