RicardoSantos

[RS]MTF Multiple Moving Averages V0

Multiple moving averages with same interval in candle bar smoothness over multiple time frames.
option to show/hide the level of resolution for the mtf's default shows 1 ma can go up to 8th resolution.
option for manual input timeframes and configure ma.
Open-source script

In true TradingView spirit, the author of this script has published it open-source, so traders can understand and verify it. Cheers to the author! You may use it for free, but reuse of this code in a publication is governed by House Rules. You can favorite it to use it on a chart.

Disclaimer

The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.

Want to use this script on a chart?
study("[RS]MTF Multiple Moving Averages V0", overlay=true)
showTF = input(1, minval=1, maxval=8)
tf1 = input('15')
tf2 = input('30')
tf3 = input('60')
tf4 = input('240')
tf5 = input('D')
tf6 = input('W')
tf7 = input('M')
tf8 = input('12M')

ma_src = input(close)
ma_length = input(4)

mtfma1 = showTF < 1 ? na : security(tickerid, tf1, sma(ma_src, ma_length))
mtfma2 = showTF < 2 ? na : security(tickerid, tf2, sma(ma_src, ma_length))
mtfma3 = showTF < 3 ? na : security(tickerid, tf3, sma(ma_src, ma_length))
mtfma4 = showTF < 4 ? na : security(tickerid, tf4, sma(ma_src, ma_length))
mtfma5 = showTF < 5 ? na : security(tickerid, tf5, sma(ma_src, ma_length))
mtfma6 = showTF < 6 ? na : security(tickerid, tf6, sma(ma_src, ma_length))
mtfma7 = showTF < 7 ? na : security(tickerid, tf7, sma(ma_src, ma_length))
mtfma8 = showTF < 8 ? na : security(tickerid, tf8, sma(ma_src, ma_length))

plot(mtfma1, style=cross, color=close >= mtfma1 ? green : maroon, linewidth=2, join=true)
plot(mtfma2, style=cross, color=close >= mtfma2 ? green : maroon, linewidth=2, join=true)
plot(mtfma3, style=cross, color=close >= mtfma3 ? green : maroon, linewidth=2, join=true)
plot(mtfma4, style=cross, color=close >= mtfma4 ? green : maroon, linewidth=2, join=true)
plot(mtfma5, style=cross, color=close >= mtfma5 ? green : maroon, linewidth=2, join=true)
plot(mtfma6, style=cross, color=close >= mtfma6 ? green : maroon, linewidth=2, join=true)
plot(mtfma7, style=cross, color=close >= mtfma7 ? green : maroon, linewidth=2, join=true)
plot(mtfma8, style=cross, color=close >= mtfma8 ? green : maroon, linewidth=2, join=true)