fix issue for 1m start time fetch logic.

This commit is contained in:
blade 2025-10-16 15:36:11 +08:00
parent 476fb36f7b
commit 2291a45e55
1 changed files with 8 additions and 3 deletions

View File

@ -115,9 +115,14 @@ class MarketDataMain:
return None return None
if bar == "1m": if bar == "1m":
# start为end_time_ts的前十五天 if isinstance(start, str):
start_time_ts = end_time_ts - 86400000 * 15 start_time_ts = transform_date_time_to_timestamp(start)
start = timestamp_to_datetime(start_time_ts) # start为end_time_ts的前十五天
if end_time_ts - start_time_ts > 86400000 * 15:
start_time_ts = end_time_ts - 86400000 * 15
start = timestamp_to_datetime(start_time_ts)
else:
start_time_ts = transform_date_time_to_timestamp(start)
else: else:
start_time_ts = transform_date_time_to_timestamp(start) start_time_ts = transform_date_time_to_timestamp(start)
if start_time_ts is None: if start_time_ts is None: