I am using following script taken from (https://in.tradingview.com/script/fH6e5TuN-RSI-Divergence/).
study(title="RSI Divergence", shorttitle="