EMA 21 + MacD + RSI + Alma
// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © markaguirre26

//@version=5
indicator(title="Moving Average Exponential", shorttitle="EMA", overlay=true, timeframe="", timeframe_gaps=true)
len = input.int(9, minval=1, title="Length")
src = input(close, title="Source")
offset = input.int(title="Offset", defval=0, minval=-500, maxval=500)
out = ta.ema(src, len)
plot(out, title="EMA", color=color.yellow, offset=offset)

ma(source, length, type) =>
    switch type
        "SMA" => ta.sma(source, length)
        "EMA" => ta.ema(source, length)
        "SMMA (RMA)" => ta.rma(source, length)
        "WMA" => ta.wma(source, length)
        "VWMA" => ta.vwma(source, length)

typeMA = input.string(title = "Method", defval = "SMA", options=["SMA", "EMA", "SMMA (RMA)", "WMA", "VWMA"], group="Smoothing")
smoothingLength = input.int(title = "Length", defval = 5, minval = 1, maxval = 100, group="Smoothing")

smoothingLine = ma(out, smoothingLength, typeMA)
plot(smoothingLine, title="Smoothing Line", color=#f37f20, offset=offset, display=display.none)


len2 = input.int(21, minval=1, title="length")
src2 = input(close, title="Source")
offset2 = input.int(title="offset2", defval=0, minval=-500, maxval=500)
out2 = ta.ema(src2, len2)
plot(out2, title="EMA", color=color.green, offset=offset2)


typeMA2 = input.string(title = "Method", defval = "SMA", options=["SMA", "EMA", "SMMA (RMA)", "WMA", "VWMA"], group="Smoothing")
smoothinglength2 = input.int(title = "length", defval = 5, minval = 1, maxval = 100, group="Smoothing")

smoothingLine2 = ma(out2, smoothinglength2, typeMA2)
plot(smoothingLine2, title="Smoothing Line", color=#f37f20, offset=offset2, display=display.none)




source = close
windowsize = input(title="Window Size", defval=20)
offset3 = input.float(title="Offset", defval=0.8)
sigma = input.float(title="Sigma", defval=8)
plot(ta.alma(source, windowsize, offset3, sigma),color=color.white)
