陈老师好,关于vnpy_optionmaster里的time.py有个疑问
def calculate_days_to_expiry(option_expiry: datetime) -> int:
""""""
current_dt = datetime.now().replace(hour=0, minute=0, second=0, microsecond=0)
days = 1
while current_dt <= option_expiry:
current_dt += timedelta(days=1)
# Ignore weekends
if current_dt.weekday() in [5, 6]:
continue
# Ignore public holidays
if current_dt in PUBLIC_HOLIDAYS:
continue
days += 1
return days
这里days初始值为1,如果我是今天(今天是20220111)到期的期权,option_expiry:20220111,那么返回的就是days就是2,可是明明今天期权就到期了