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

//@version=5
indicator(title='MAIndicator', overlay=true)


shortMA = input.int(30, "Short EMA", minval = 1)
longMA = input.int(54, "Long EMA", minval = 1)

shortEMA = ta.ema(close,shortMA)
longEMA = ta.ema(close,longMA)

plot(shortEMA, "short EMA", color = color.green, linewidth = 3)
plot(longEMA, "long EMA", color = color.red, linewidth = 3)

plotBuy = ta.crossover(shortEMA, longEMA)
plotSell = ta.crossunder(shortEMA, longEMA)

plotshape(plotSell, title="Sell", text="Sell", location=location.belowbar, style=shape.labelup, size=size.tiny, color=color.red, textcolor=color.white)
plotshape(plotBuy, title="Buy", text="Buy", location=location.abovebar, style=shape.labeldown, size=size.tiny, color=color.green, textcolor=color.white)