quantdata.massive.expiries#
quantdata.massive.expiries
Per-ticker option expiry flags via the Massive API.
For each trading day, checks whether ANY option on the underlying expires on that day and classifies it (MONTHLY, QUAD_WITCHING, etc.).
The ticker_expiries() function uses an incremental cache: it only fetches the
dates that are not already stored, so repeated calls for overlapping date ranges are
cheap.
- quantdata.massive.expiries.classify_expiry(df)[source]#
Add
has_expiry(Int8, values fromquantdata.tickers.ticker_calendar.EXPIRY) to a DataFrame that already contains adatecolumn of trading days.The classification is purely calendar-based:
EXPIRY.QUAD_WITCHING: shifted third Friday of Mar/Jun/Sep/DecEXPIRY.MONTHLY: shifted third Friday of other monthsEXPIRY.NORMAL: any other trading day
- quantdata.massive.expiries.ticker_expiries_day(ticker, dt)[source]#
Check via the Massive API whether any option on
tickerexpires ondt.- Returns:
expiry_codeis anEXPIRYint value, orNoneif no options expire.- Return type:
(dt, expiry_code)
- quantdata.massive.expiries.ticker_expiries(ticker, business_days, *, num_workers=-2, threading=False, verbose=<cdxcore.verbose.Context object>)[source]#
For each date in
business_days, flag whether any option ontickerexpires (0-DTE check) and return the expiry type.Results are stored in an incremental cache keyed by
tickerso only the missing dates are fetched on subsequent calls.- Parameters:
- Returns:
Columns: date (Date), has_expiry (Int8) — only rows where has_expiry is not null.
- Return type:
pl.DataFrame