fix: hk_scanner修bars访问——fetch_tx_klines返回dict列表,用b[close]/b.get(volume)而非下标
This commit is contained in:
@@ -59,8 +59,8 @@ def check_hk_mr1(code):
|
||||
bars = fetch_tx_klines(code, datalen=120)
|
||||
if not bars or len(bars) < 65:
|
||||
return None
|
||||
closes = [b[2] for b in bars] # close 在第3列(date,open,close,...)
|
||||
vols = [b[5] if len(b) > 5 else 0 for b in bars]
|
||||
closes = [b["close"] for b in bars] # fetch_tx_klines 返回 dict 列表
|
||||
vols = [b.get("volume", 0) for b in bars]
|
||||
c = closes[-1]
|
||||
ma60 = sum(closes[-60:]) / 60
|
||||
if not c or ma60 <= 0:
|
||||
|
||||
Reference in New Issue
Block a user