$ADA

strategy("EMA 50/200 + RSI Bot", overlay=true, default_qty_type=strategy.percent_of_equity, default_qty_value=100)

// Indikatori
ema50 = ta.ema(close, 50)
ema200 = ta.ema(close, 200)
rsi = ta.rsi(close, 14)

// Uslovi za long ulazak
longCondition = ema50 > ema200 and close > ema50 and rsi > 40 and rsi < 60
if (longCondition)
strategy.entry("Buy", strategy.long)

// Uslovi za izlazak (TP/SL)
tpPerc = 0.1 // 10% take profit
slPerc = 0.05 // 5% stop loss
strategy.exit("TP/SL", from_entry="Buy", profit=tpPerc close, loss=slPerc close)

// Crtanje EMAs
plot(ema50, color=color.orange, title="EMA 50")
plot(ema200, color=color.blue, title="EMA 200")