Error While Fetching Option Chain Data

Hi @Tradehull_Imran Sir
i am getting error while fetching option chain data with updated tradehull_v2 file

option_chain = tsl.get_option_chain(“NIFTY”, “INDEX”,“2025-09-30”,10)

Error: (Pdb++) option_chain = tsl.get_option_chain(“NIFTY”, “INDEX”,“2025-09-30”,10)
Getting Error at Option Chain as ‘<’ not supported between instances of ‘int’ and ‘str’

Hi @Surendra_Singh1 ,

Thanks for bringing this up. @Tradehull_Imran may be able to assist here

Hi @Surendra_Singh1 ,

Refer the below code:

 option_chain = tsl.get_option_chain(Underlying="NIFTY", exchange="INDEX", expiry=0, num_strikes=10)
  • expiry (int): Index of the expiry date in the list of available expiry dates
    0 for the nearest expiry
    1 for next expiry and so on.

Refer the below link for usage of functions
Dhan-Tradehull · PyPI

1 Like

Hi @Tradehull_Imran ,
Thanks for replying i got the option chain data but we are getting option greek (‘delta’) value wrong for weekly expiry strikes Nifty option chain
for monthly expiry we get correct value for stocks options as i use below code

delta_values = tsl.get_option_greek(strike=25200, expiry=0, asset=‘NIFTY’, interest_rate=10, flag=‘delta’, scrip_type=‘CE’)