修复bug
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user