feat(HEL-421): 回补历史日历和指数并标记区间不完整
Co-authored-by: Cursor <cursoragent@cursor.com> Co-authored-by: multica-agent <github@multica.ai>
This commit is contained in:
co-authored by
Cursor
multica-agent
parent
25ff6bbe06
commit
a836cda1b2
@@ -58,6 +58,16 @@ def add_days(trade_date: str, days: int) -> str:
|
||||
return (parse_trade_date(trade_date) + timedelta(days=days)).strftime("%Y%m%d")
|
||||
|
||||
|
||||
def iter_yyyymmdd(start: str, end: str):
|
||||
cursor = parse_trade_date(start)
|
||||
last = parse_trade_date(end)
|
||||
if cursor > last:
|
||||
return
|
||||
while cursor <= last:
|
||||
yield cursor.strftime("%Y%m%d")
|
||||
cursor += timedelta(days=1)
|
||||
|
||||
|
||||
def utc_timestamp(value: Any) -> str:
|
||||
if isinstance(value, datetime):
|
||||
return isoformat(value)
|
||||
|
||||
Reference in New Issue
Block a user