Multiple Stock RSI Check
// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © sateesh1496

//@version=5
// Define the symbols of the stocks to check
t1 = input.symbol('NSE:HDFCBANK')
t2 = input.symbol('NSE:ICICIBANK')
t3 = input.symbol('NSE:KOTAKBANK')
t4 = input.symbol('NSE:AXISBANK')
t5 = input.symbol('NSE:SBIN')

indicator('Multiple Stock RSI Check')

// Define a variable to keep track of the count of stocks with RSI > 55
count = 0

//get historical close prices for each stock
closePrice1 = request.security(t1, 'D', close)
closePrice2 = request.security(t2, 'D', close)
closePrice3 = request.security(t3, 'D', close)
closePrice4 = request.security(t4, 'D', close)
closePrice5 = request.security(t5, 'D', close)

//Get the RSI of the stocks
rsi1 = ta.rsi(closePrice1, 14)
rsi2 = ta.rsi(closePrice2, 14)
rsi3 = ta.rsi(closePrice3, 14)
rsi4 = ta.rsi(closePrice4, 14)
rsi5 = ta.rsi(closePrice5, 14)

//Checking RSI of each stock
if rsi1 > 55
    count += 1
    count
if rsi2 > 55
    count += 1
    count
if rsi3 > 55
    count += 1
    count
if rsi4 > 55
    count += 1
    count
if rsi5 > 55
    count += 1
    count

//Plotting the count
plot(count, style=plot.style_histogram)
//label.new(bar_index, high, tostring(count) + " stocks RSI > 55")



