How to Create Variable for Max OI Strike in Bank Nifty

I want to create Instrument for Max OI Strike, so that at market Opening 0915, it records CE and PE strikes and CE and PE Instruments so that they could be fetched via Get runtime and EMA crossover could be used on these instruments. I have tried as below attached images. But they are not working.

Please help in finding the exact solution.