Strategy Build- Stock List and RSI and Supertrend

Based on excel data analysis of NSE data, we will be getting a list of stocks to buy or sell next day. I wanted to take position either in cash market or future with SL (yesterday high or low), preferably via API with list of stocks fetched from txt or excel file.

As part of exit strategy, script should check my demat accounts in demat account. Exit from Long/Short position as below

For Long position, if 4 Hrs RSI goes below 50 and/or supertrend changes to sell and/or SL hit (, exit the long position
For Short Position, if 4 hrs RSI goes above 50 and/or supertrend changes to buy and/or SL hit, exit the short position