Fix recommend table missing trend/daily stats when CTP klines are sparse.
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user