修复bug

This commit is contained in:
dekun
2026-05-18 08:10:28 +08:00
parent 24550b0ce0
commit 82a7237063
8 changed files with 132 additions and 58 deletions
+3 -8
View File
@@ -4,6 +4,8 @@ import base64
import io
import logging
from .candle_rows import rows_to_ohl
LOGGER = logging.getLogger("onchain_scout.chart_candles")
@@ -22,14 +24,7 @@ def daily_candles_png_base64(rows_1d: list[list[str]], symbol: str, max_bars: in
LOGGER.warning("matplotlib not installed, skip chart image")
return None
o, h, l, c, _ = [], [], [], [], []
for item in rows_1d:
if len(item) < 6:
continue
o.append(float(item[1]))
h.append(float(item[2]))
l.append(float(item[3]))
c.append(float(item[4]))
o, h, l, c = rows_to_ohl(rows_1d)
n = len(c)
if n < 5:
return None