update market data as first action.

This commit is contained in:
blade 2025-10-16 16:17:35 +08:00
parent beb0991af2
commit 1e6caf51e0
2 changed files with 10 additions and 2 deletions

View File

@ -166,7 +166,6 @@ class HugeVolumeMain:
for symbol in self.market_data_main.symbols:
for bar in self.market_data_main.bars:
try:
self.market_data_main.update_data(symbol, bar)
self.update_volume_spike(symbol, bar, window_size)
except Exception as e:
logger.error(
@ -666,6 +665,15 @@ def batch_update_volume_spike(threshold: float = 2.0, is_us_stock: bool = False)
):
window_sizes = [50, 80, 100, 120]
huge_volume_main = HugeVolumeMain(threshold, is_us_stock, is_binance=False)
for symbol in huge_volume_main.market_data_main.symbols:
for bar in huge_volume_main.market_data_main.bars:
try:
huge_volume_main.market_data_main.update_data(symbol, bar)
except Exception as e:
logger.warning(
f"更新交易数据失败: {symbol} {bar}: {e}"
)
for window_size in window_sizes:
huge_volume_main.batch_update_volume_spike(window_size=window_size)

View File

@ -117,8 +117,8 @@ class MarketDataMain:
if bar == "1m":
if isinstance(start, str):
start_time_ts = transform_date_time_to_timestamp(start)
# start为end_time_ts的前十五天
if end_time_ts - start_time_ts > 86400000 * 15:
# start为end_time_ts的前十五天
start_time_ts = end_time_ts - 86400000 * 15
start = timestamp_to_datetime(start_time_ts)
elif isinstance(start, int):