How to code this BNF Options strategy

I am trying to create a BNF expiry strategy. Can someone please help me?

Entry -
Expiry Day Trading Only
Check Open Price of Bank Nifty Spot at 9.08AM
If Todays Open price > of Previous close then Short Put (Strike Price - Opening price ATM - 100 points)
if Todays Open price < of Previous close then Short Call (Strike Price - Opening price ATM + 100 points)

Order Should be Limit Order at Open Price at 9.15am
SL - 2x of Open price
E.g. - If 30100 Strike Open Price is 100, then place Limit Order at 100. SL will be 200

Close Position at 3.20PM Or SL

No new trade if SL Hit
No Trade entry if Opening price is >+/-1% from previous day close

Thank you

@Learn can you please help with this? Thank you

I doubt whether this is possible as you are asking to check spot at 9.08am. Order for Pre-open market This hread says TT doesn’t support pre-market open. @Ujjwal is master.

As per the thread punching order isn’t possible. Please check whether price data of pre-open period is available at 9.15am. If yes, we can sync up over the week end.

@msmukesh459did you check above?