+7
-1
@@ -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,
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user