Hi @Ketan_Gupta , sorry for the confusion. let me clarify the workflow i’ve written-
- I download the .json file from https://assets.upstox.com/market-quote/instruments/exchange/NSE.json.gz. This gives me NSE.json
- I then load this NSE.json into a dataframe and then spit it back out as a NSE.csv. This is not the .csv which might have existed with upstox but instead a transposition of the .json to .csv
so now we have this cleared, step3 is
3. The NSE.json has a field called expiry, sample here-
{“weekly”:true,“segment”:“NSE_FO”,“name”:“NIFTY”,“exchange”:“NSE”,“expiry”:1750357799000,“instrument_type”:“CE”,“asset_symbol”:“NIFTY”,“underlying_symbol”:“NIFTY”,“instrument_key”:“NSE_FO|50917”,“lot_size”:75,“freeze_quantity”:1800.0,“exchange_token”:“50917”,“minimum_lot”:75,“asset_key”:“NSE_INDEX|Nifty 50”,“underlying_key”:“NSE_INDEX|Nifty 50”,“tick_size”:5.0,“asset_type”:“INDEX”,“underlying_type”:“INDEX”,“trading_symbol”:“NIFTY 23550 CE 19 JUN 25”,“strike_price”:23550.0,“qty_multiplier”:1.0},
- next step is to then sort on expiry. Here i expected to find 1750895400000 which would effectively convert into 26th June which does not exist.
What going on is that the instrument is there for the 26th June but its mapped against the expiry of 1750962599000, this number converts into 25th July
Please clarify for me if I’m accessing the correct link for the .json file ?
I can find the expiry field in the .json, can you confirm the same as well ?
Can you then check for mapping of expiry time to the instrument ?
here is the same instrument as you were considering from the .json file
{“weekly”:false,“segment”:“NSE_FO”,“name”:“NIFTY”,“exchange”:“NSE”,“expiry”:1750962599000,“instrument_type”:“PE”,“asset_symbol”:“NIFTY”,“underlying_symbol”:“NIFTY”,“instrument_key”:“NSE_FO|50970”,“lot_size”:75,“freeze_quantity”:1800.0,“exchange_token”:“50970”,“minimum_lot”:75,“asset_key”:“NSE_INDEX|Nifty 50”,“underlying_key”:“NSE_INDEX|Nifty 50”,“tick_size”:5.0,“asset_type”:“INDEX”,“underlying_type”:“INDEX”,“trading_symbol”:“NIFTY 27000 PE 26 JUN 25”,“strike_price”:27000.0,“qty_multiplier”:1.0}