sohail Anjum EMA buy sell
// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0
//@version=5
indicator('sohail Anjum EMA buy sell', shorttitle = 'SA Ema', overlay=true)
fema = input(12, title='12 Ema')
sema = input(26, title='26 Ema')
fastEma = ta.ema(close, fema)
slowEma = ta.ema(close, sema)
ema200 = ta.ema(close, 200)

plot(fastEma, color=color.new(color.green, 0),linewidth=2)
plot(slowEma, color=color.new(color.red, 0),linewidth=2)
plot(ema200, color=color.new(color.yellow, 22),linewidth=3)



//rsi

rsivalue = ta.rsi(close, 14)


Buy=ta.crossover(fastEma, slowEma) and (rsivalue > 50) 
Sell=ta.crossunder(fastEma, slowEma) and (rsivalue < 35) //and (close < ema200) and (rsivalue < 35)

plotshape(Buy, title='Buy', text='Buy', style=shape.labelup, location=location.belowbar, color=color.new(color.green, 0), size=size.small)
plotshape(Sell, title='Sell', text='Sell', style=shape.labeldown, location=location.abovebar, color=color.new(color.red, 0), size=size.small)

alertcondition(Buy, 'ema Long', 'ema Long')
alertcondition(Sell, 'ema Short', 'ema Short')