supertrend = close > trendUp ? trendUp : close < trendDown ? trendDown : na supertrendDirection = close > supertrend ? 1 : close < supertrend ? -1 : na
// Alert Conditions alertcondition(buySignal, title="Buy Alert", message="BUY Signal: Supertrend is bullish and RSI is oversold") alertcondition(sellSignal, title="Sell Alert", message="SELL Signal: Supertrend is bearish and RSI is overbought")