Fix recommend table missing trend/daily stats when CTP klines are sparse.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
dekun
2026-07-03 13:00:03 +08:00
parent 08be5f34c8
commit 61481d5749
2 changed files with 13 additions and 5 deletions
+2 -1
View File
@@ -317,7 +317,8 @@ def fetch_market_klines(
except Exception as exc:
logger.debug("ctp kline fetch failed %s %s: %s", symbol, p, exc)
need_sina = not prefer_ctp or force_remote
# prefer_ctp 时 CTP bar 不足仍须用新浪/本地缓存补齐(否则走势、跳空等日线统计为空)
need_sina = force_remote or not prefer_ctp or len(ctp_bars) < MIN_CTP_KLINE_BARS
if ctp_bars and len(ctp_bars) >= MIN_CTP_KLINE_BARS:
bars = ctp_bars
source = "ctp"