put this script in tradingview in Pine editor here is the script //@version=5
indicator("EMA Crossover Alert", overlay=true)
// Define the EMA periods
shortEmaPeriod = 10
longEmaPeriod = 20
// Calculate the EMAs
shortEma = ta.ema(close, shortEmaPeriod)
longEma = ta.ema(close, longEmaPeriod)
// Plot the EMAs on the chart
plot(shortEma, color=color.blue, title="10 EMA")
plot(longEma, color=color.red, title="20 EMA")
// Generate buy and sell signals
buySignal = ta.crossover(shortEma, longEma)
sellSignal = ta.crossunder(shortEma, longEma)
// Plot buy and sell signals on the chart
plotshape(series=buySignal, location=location.belowbar, color=color.green, style=shape.labelup, text="BUY")
plotshape(series=sellSignal, location=location.abovebar, color=color.red, style=shape.labeldown, text="SELL")
// Create alerts
alertcondition(buySignal, title="Buy Alert", message="10 EMA has crossed above 20 EMA")
alertcondition(sellSignal, title="Sell Alert", message="10 EMA has crossed below 20 EMA")