Code to get ltp based on delta in zerodha

Hi Team,

Can you please share code to choose ltp based on delta in Zerodha?

Regards, Sobhit

Hi @Sobhit ,

Below is the code to chose ltp based on delta:

step = 50
Nifty_ltp  = tsl.get_data_for_single_script(exchange="NSE", name="NIFTY 50", call_type ="ltp")
atm_strike = round(Nifty_ltp /step) * step 

for multiplier in range(1,10):

    otm_strike = atm_strike + (50*multiplier)

    ce_delta = tsl.get_option_greek(strike=otm_strike, expiry_date="2025-03-13", asset="NIFTY 50", interest_rate=10, flag="delta", scrip_type="CE")


    if ce_delta < 0.3:
        print("Found the strike which has delta < 0.3")