Golden Gate
// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © vaibhavpatil216

//@version=5
indicator(title="Golden Gate", shorttitle="EMA", overlay=true, timeframe="", timeframe_gaps=true)

len20 = input.int(20, minval=1, title="Length")
src20 = input(close, title="Source")
offset20 = input.int(title="Offset", defval=0, minval=-500, maxval=500)
out20 = ta.ema(src20, len20)
plot(out20, title="EMA", color=color.blue, offset=offset20)

ma(source, length, type) =>
    switch type
        "EMA" => ta.ema(source, length)
typeMA20 = input.string(title = "Method", defval = "EMA", options=["EMA"])

len50 = input.int(50, minval=1, title="Length")
src50 = input(close, title="Source")
offset50 = input.int(title="Offset", defval=0, minval=-500, maxval=500)
out50 = ta.ema(src50, len50)
plot(out50, title="EMA", color=color.red, offset=offset50)

ma50(source, length, type) =>
    switch type
        "EMA" => ta.ema(source, length)
typeMA50 = input.string(title = "Method", defval = "EMA", options=["EMA"])

len200 = input.int(200, minval=1, title="Length")
src200 = input(close, title="Source")
offset200 = input.int(title="Offset", defval=0, minval=-500, maxval=500)
out200 = ta.ema(src200, len200)
plot(out200, title="EMA", color=color.lime, offset=offset200)

ma200(source, length, type) =>
    switch type
        "EMA" => ta.ema(source, length)
typeMA200 = input.string(title = "Method", defval = "EMA", options=["EMA"])

len100 = input.int(100, minval=1, title="Length")
src100 = input(close, title="Source")
offset100 = input.int(title="Offset", defval=0, minval=-500, maxval=500)
out100 = ta.ema(src100, len100)
plot(out100, title="EMA", color=color.rgb(226, 230, 0), offset=offset100)

ma100(source, length, type) =>
    switch type
        "EMA" => ta.ema(source, length)
typeMA100 = input.string(title = "Method", defval = "EMA", options=["EMA"])

