Kotak-Neo / kotak-neo-api

119 stars 111 forks source link

Instrument are Showing Expiry Date Wrong (Lag of 1 Day) #231

Open anup-patel opened 2 months ago

anup-patel commented 2 months ago

Instrument are Showing Expiry Date Wrong (Lag of 1 Day) Check for MIDCAP nifty Expiry Instrument Dates

tradeautumn commented 1 month ago

I was also stuck on the same. Realized that it is IBM epoch Vs Unix epoch. Add the difference in sec and you should be ok. Sample Code: expiry_list = options_expiry['lExpiryDate '].sort_values().unique()

convert IBM epoch to unix epoch

format_expiry   = [datetime.fromtimestamp(epoch + 315511200).strftime('%d-%m-%Y') for epoch in expiry_list]