//version=5
indicator(“RSI Buy Alert”, overlay=true)
// RSI Settings
rsiSource = close
rsiLength = 14
rsi = ta.rsi(rsiSource, rsiLength)
// RSI Thresholds
rsiBuyLevel = 30
// Buy Condition: RSI crosses below and then back above 30
buySignal = ta.crossover(rsi, rsiBuyLevel)
// Plot Buy Signal on Chart
plotshape(buySignal, title=”Buy Signal”, location=location.belowbar, color=color.green, style=shape.labelup, text=”BUY”)
// Alert Condition
alertcondition(buySignal, title=”Buy Alert”, message=”RSI Buy Signal: RSI crossed above 30″)
// Optional: Show RSI on separate pane if desired
plot(rsi, title=”RSI”, color=color.purple)
hline(30, “Strong Buy”, color=color.green)
hline(70, “Strong Sell”, color=color.red)