Option Strike Price json options for webhook tradingview

I want to trade with webhook tradingview , but while generating the jason script for opting trading of Nifty, the strike price is mentioned, but i want the strike price to be selected automatically i.e it should be ATM or OTM or ITM as per market price or it should be selected dynamically, please help me how can i edit the same , in the code. My mob No: 8277182549

Example of jason script generated with strike price

{“secret”:“uXB5h”,“alertType”:“multi_leg_order”,“order_legs”:[{“transactionType”:“B”,“orderType”:“MKT”,“quantity”:“1”,“exchange”:“NSE”,“symbol”:“NIFTY”,“instrument”:“OPT”,“productType”:“I”,“sort_order”:“1”,“price”:“0”,“option_type”:“CE”,“strike_price":"21700.0”,“expiry_date”:“2024-01-04”},{“transactionType”:“B”,“orderType”:“MKT”,“quantity”:“1”,“exchange”:“NSE”,“symbol”:“NIFTY”,“instrument”:“OPT”,“productType”:“I”,“sort_order”:“2”,“price”:“0”,“option_type”:“PE”,“strike_price":"21700.0”,“expiry_date”:“2024-01-04”}]}

i want the strike price to be selected automatically based on market price.

Please help me in this regard, waiting for your reply.

Thank you.

longstrikeprice := (math.round(close / 100) * 100)
//For ATM +1[ BankNifty based on 100 points] so +100 is for ATM+1 and -100 is for ITM
longpriceCondition:= longstrikeprice + 100

“strike_price”:“’ + str.tostring(longpriceCondition) + '”

{“secret”:“uXB5h”,“alertType”:“multi_leg_order”,“order_legs”:[{“transactionType”:“B”
“orderType”:“MKT”
“quantity”:“1”
“exchange”:“NSE”
“symbol”:“NIFTY”
“instrument”:“OPT”
“productType”:“I”
“sort_order”:“1”
“price”:“0”
“option_type”:“CE”
“strike_price":"+ str.tostring(longpriceCondition) +”
“expiry_date”:“2024-01-04”},

will above code work now for ATM…?

I need your help in coding my strategy , can you please provide me your whatsapp number , my whatsapp number is +918277182549