feat: 行情K线优先CTP tick聚合,修复手续费同步主力列表解析

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
dekun
2026-06-24 13:18:43 +08:00
parent 09f4649d79
commit 3fe4add8e1
8 changed files with 390 additions and 24 deletions
+11 -2
View File
@@ -114,7 +114,12 @@ class KlineStreamHub:
logger.warning("kline refresh check failed: %s", exc)
return True
def worker_loop(self, db_path: str, quote_fn: Callable[..., dict]) -> None:
def worker_loop(
self,
db_path: str,
quote_fn: Callable[..., dict],
get_mode_fn: Optional[Callable[[], str]] = None,
) -> None:
while True:
try:
subs = self._snapshot_subs()
@@ -123,7 +128,11 @@ class KlineStreamHub:
continue
try:
kline_data = fetch_market_klines(
sub.symbol, sub.period, db_path, force_remote=True,
sub.symbol,
sub.period,
db_path,
force_remote=True,
trading_mode=get_mode_fn() if get_mode_fn else None,
)
if kline_data.get("bars"):
self.publish(sub, "kline", kline_data)