The script simply divides the stock by three different symbols (default NIFTY, CNX100, and CNX500) to measure the underlying performance. The symbols are configurable (for example change with underlying sector/etc.) to measure multiple performances together.
The relative strength indicator measures the symbol's performance and informs whether it is underperforming or outperforming with the underlying symbol.