running my algo on AWS earlier it is working fine but some time it giving FINNifty data for this ITM strike selection and inside print you can see latest latest file all_instrument 2025-03-24.csv is downloaded but still it giving data for FINNIFTY. i debug the code as well but still getting same result. @Tradehull_Imran @Tradehull
i fixed issue you need to change your dhanV2 library code line no 999 to 1000
you have to remove contains condition need to add .startWith because FINNIFTY also contain NIFTY as string.
if Underlying in self.index_step_dict:
ce_condition = (instrument_df['SEM_EXM_EXCH_ID'] == exchange) & ((instrument_df['SEM_TRADING_SYMBOL'].str.startswith(Underlying))|(instrument_df['SEM_CUSTOM_SYMBOL'].str.contains(Underlying))) & (instrument_df['ContractExpiration'] == Expiry_date) & (instrument_df['SEM_OPTION_TYPE']=='CE')
pe_condition = (instrument_df['SEM_EXM_EXCH_ID'] == exchange) & ((instrument_df['SEM_TRADING_SYMBOL'].str.startswith(Underlying))|(instrument_df['SEM_CUSTOM_SYMBOL'].str.contains(Underlying))) & (instrument_df['ContractExpiration'] == Expiry_date) & (instrument_df['SEM_OPTION_TYPE']=='PE')