Hi there,
Is there any way that i can get the next option expiry date of a contract on Blueshift ?
Thanks !!
Hi there,
Is there any way that i can get the next option expiry date of a contract on Blueshift ?
Thanks !!
You can possibly get the next option in the rolling series with a dt specified and check its expiry_date. For example, if you are dealing with weekly options on NIFTY, and want to see the expiry date of the next week, try
from blueshift.api import get_datetime, symbol
# remember to use dt=get_datetime() to get a dated instrument from the rolling symbol
opt=symbol('NIFTY-W1CE+0', dt=get_datetime()) # get the next option instrument
expiry = opt.expiry_date # get the expiry date
See docs for symbol, rolling contracts symbology, and asset attributes.