Backtesting Options - how to refer to index price

I am new to Zerodha. If I want to back test Nifty options, how do I refer to the Nifty Index price from the Trade Script code?

For example, if I want to initiate a buy in NIFTY17FEB8450 PE when Nifty spot price went above 8600, how do I write a buy script for NIFTY17FEB8450 PE?

Cross referencing of Scrips is not possible on Tradescript.