This teaching indicator checks whether RSI crossed above 50 on the previous completed requested bar. Use a standard time-based chart with an interval below the requested timeframe. It combines matching symbols into one message on the host bar close when a new requested bar is observed. It deliberately waits for completed data; it is not an immediate intrabar scanner.
Pine Script v6: two explicit symbols, one aggregated alertpinescript
//@version=6
indicator("Two-symbol confirmed RSI monitor", overlay=false)
string symbol1 = input.symbol("NASDAQ:AAPL", "Symbol 1")
string symbol2 = input.symbol("NASDAQ:MSFT", "Symbol 2")
string requestedTf = input.timeframe("1D", "Requested timeframe")
int length = input.int(14, "RSI length", minval=2)
if timeframe.in_seconds(requestedTf) <= timeframe.in_seconds()
runtime.error("Requested timeframe must be higher than the chart timeframe.")
confirmedSignal() =>
float rsi = ta.rsi(close, length)
bool crossed = ta.crossover(rsi, 50)
[crossed[1], time[1], rsi[1]]
[hit1, stamp1, rsi1] = request.security(symbol1, requestedTf, confirmedSignal(), lookahead=barmerge.lookahead_on)
[hit2, stamp2, rsi2] = request.security(symbol2, requestedTf, confirmedSignal(), lookahead=barmerge.lookahead_on)
bool fresh1 = not na(stamp1[1]) and stamp1 != stamp1[1]
bool fresh2 = not na(stamp2[1]) and stamp2 != stamp2[1]
string message = ""
if fresh1 and hit1
message += symbol1 + " RSI crossed above 50; RSI=" + str.tostring(rsi1, "#.##") + "; "
if fresh2 and hit2 and symbol2 != symbol1
message += symbol2 + " RSI crossed above 50; RSI=" + str.tostring(rsi2, "#.##") + "; "
if barstate.isconfirmed and str.length(message) > 0
alert(message, alert.freq_once_per_bar_close)
plot(rsi1, "Symbol 1 confirmed RSI", color=color.blue)
plot(rsi2, "Symbol 2 confirmed RSI", color=color.orange)
hline(50, "Threshold")