smart traderEuro/US DollarFX:EURUSDIdriscoko//@version=5 strategy("EUR/USD RSI EMA Signal Strategy", overlay=true, default_qty_type=strategy.percent_of_equity, default_qty_value=10) // === Input Parameters === rsiPeriod = input.int(14, title="RSI Period") rsiOverbought = input.int(70, title="RSI Overbought Level") rsiOversold = input.int(30, title="RSI Oversold Level") emaPeriod = input.int(20, title="EMA Period") takeProfitPips = input.float(30, title="Take Profit (pips)", step=1) stopLossPips = input.float(20, title="Stop Loss (pips)", step=1) // === Calculations === price = close ema = ta.ema(price, emaPeriod) rsi = ta.rsi(price, rsiPeriod) // === Convert pips to price (1 pip = 0.0001 for EUR/USD) === pip = 0.0001 tp = takeProfitPips * pip sl = stopLossPips * pip // === Buy Condition === buySignal = (rsi < rsiOversold) and (price > ema) and (ta.crossover(price, ema)) if buySignal strategy.entry("Buy", strategy.long) strategy.exit("TP/SL Buy", from_entry="Buy", profit=tp, loss=sl) // === Sell Condition === sellSignal = (rsi > rsiOverbought) and (price < ema) and (ta.crossunder(price, ema)) if sellSignal strategy.entry("Sell", strategy.short) strategy.exit("TP/SL Sell", from_entry="Sell", profit=tp, loss=sl) // === Plot EMA === plot(ema, title="EMA", color=color.orange)