BYBIT:BNBUSDT.P   BNBUSDT Perpetual Contract
//@version=4
strategy("5-Minute Chart Strategy", overlay=true)

// Input parameters
rsiLength = input(14, title="RSI Length")
overbought = input(70, title="Overbought Level")
oversold = input(30, title="Oversold Level")
emaLength = input(20, title="EMA Length")

// Calculate RSI
rsi = rsi(close, rsiLength)

// Calculate EMA
ema = ema(close, emaLength)

// Define entry and exit conditions
if crossover(close, ema) and rsi < oversold
strategy.entry("Buy", strategy.long)
if crossunder(close, ema) and rsi > overbought
strategy.entry("Sell", strategy.short)

// Plot EMA
plot(ema, color=color.blue)

// Plot RSI
plot(rsi, color=color.red)

Disclaimer

The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.