Risk Management & Position Size Dashboard
// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © aj7919

//@version=5
indicator("3 Moving Averages", overlay = true, timeframe = "60")


timeframe = input.string("H12", title = "HTF Timeframe", options = ["H1", "H4", "H12", "D", "W"])
maType = input.string("EMA", title = "Type", options = ["EMA", "SMA", "VWMA"])
ma1 = input.int(13, title = "Moving Average 1")
ma2 = input.int(21, title = "Moving Average 2")
ma3 = input.int(24, title = "Moving Average 3")

timeFrame1 = timeframe == "H1" ? ma1 : timeframe == "H4" ? ma1 * 4 : timeframe == "H12" ? ma1 * 12 : timeframe == "D" ? ma1  * 24 : timeframe == "W" ? ma1 * 168 : na
timeFrame2 = timeframe == "H1" ? ma2 : timeframe == "H4" ? ma2 * 4 : timeframe == "H12" ? ma2 * 12 : timeframe == "D" ? ma2  * 24 : timeframe == "W" ? ma2 * 168 : na
timeFrame3 = timeframe == "H1" ? ma3 : timeframe == "H4" ? ma3 * 4 : timeframe == "H12" ? ma3 * 12 : timeframe == "D" ? ma3  * 24 : timeframe == "W" ? ma3 * 168 : na

mA1 = maType == "EMA" ? ta.ema(close,timeFrame1) : maType == "SMA" ? ta.sma (close, timeFrame1): maType == "VWMA" ? ta.vwma(close, timeFrame1) : na
mA2 = maType == "EMA" ? ta.ema(close,timeFrame2) : maType == "SMA" ? ta.sma (close, timeFrame2): maType == "VWMA" ? ta.vwma(close, timeFrame2) : na
mA3 = maType == "EMA" ? ta.ema(close,timeFrame3) : maType == "SMA" ? ta.sma (close, timeFrame3): maType == "VWMA" ? ta.vwma(close, timeFrame3) : na

plot(mA1,color = color.new(#f43636, 80))
plot(mA2,color = color.new(#52f3ff, 80))
plot(mA3,color = color.new(#c6eb3e, 80))