Skip to content

Fix intraday-timestamp crash in trading-date scheduling (#69)#264

Open
MBemera wants to merge 1 commit into
HKUDS:Official-AITrader-v1from
MBemera:fix/issue-69-date-parsing
Open

Fix intraday-timestamp crash in trading-date scheduling (#69)#264
MBemera wants to merge 1 commit into
HKUDS:Official-AITrader-v1from
MBemera:fix/issue-69-date-parsing

Conversation

@MBemera

@MBemera MBemera commented Jul 8, 2026

Copy link
Copy Markdown

Addresses #69.

get_trading_dates crashed on timestamped position dates (unconverted data remains). Now parses them via the tolerant parse_date.

Position data ships dates like '2025-10-01 10:00:00', but get_trading_dates
parsed them with a date-only strptime, raising 'unconverted data remains:
11:00:00' on 'python3 main.py'. The US agent had an ad-hoc split() guard; the
A-share and crypto agents did not.

Centralize the duplicated logic into tools.price_tools.compute_trading_dates,
parsing every date field with the existing utils.date_utils.parse_date (which
accepts both 'YYYY-MM-DD' and 'YYYY-MM-DD HH:MM:SS'), and iterate on calendar
dates so an intraday timestamp cannot drop the final day. The three daily
agents now delegate to it.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant