行情K线:分类主力选择、图表指标与布局稳定

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
dekun
2026-06-15 18:23:39 +08:00
parent 65992eb35e
commit 404872007f
8 changed files with 644 additions and 114 deletions
+7 -1
View File
@@ -274,13 +274,19 @@ def fetch_market_klines(
except Exception as exc:
logger.warning("kline cache fallback failed %s %s: %s", chart_sym, p, exc)
api_bars = bars_to_api(bars)
prev_close = None
if len(api_bars) >= 2:
prev_close = api_bars[-2]["close"]
return {
"symbol": symbol,
"chart_symbol": chart_sym,
"period": p,
"chart_type": chart_type,
"count": len(bars),
"bars": bars_to_api(bars),
"bars": api_bars,
"prev_close": prev_close,
"source": source,
"cached_at": cached_at,
}