1. Smart Multi-EMA Crossover Pine v5
This moving average indicator combines 20-period and 50-period Exponential Moving Averages (EMA). The chart background turns green during a BUY signal and shifts to red on a SELL signal.
//@version=5
indicator("Smart Multi-EMA Crossover", overlay=true)
fastLength = input.int(20, title="Fast EMA Length")
slowLength = input.int(50, title="Slow EMA Length")
fastEMA = ta.ema(close, fastLength)
slowEMA = ta.ema(close, slowLength)
plot(fastEMA, color=color.blue, title="Fast EMA", linewidth=2)
plot(slowEMA, color=color.orange, title="Slow EMA", linewidth=2)
bullishBuy = ta.crossover(fastEMA, slowEMA)
bearishSell = ta.crossunder(fastEMA, slowEMA)
bgcolor(fastEMA > slowEMA ? color.new(color.green, 90) : color.new(color.red, 90))
plotshape(bullishBuy, title="Buy Signal", style=shape.triangleup, location=location.belowbar, color=color.green, size=size.small)
plotshape(bearishSell, title="Sell Signal", style=shape.triangledown, location=location.abovebar, color=color.red, size=size.small)