fix: price_monitor.py 连环bug - 缺失import json + 元组解包不匹配
This commit is contained in:
@@ -4,9 +4,7 @@
|
||||
每次运行时一次性刷新所有持仓+自选股的实时价。
|
||||
"""
|
||||
import urllib.request
|
||||
import os
|
||||
import sys
|
||||
import time
|
||||
import os, sys, time, json
|
||||
import sqlite3
|
||||
from datetime import datetime
|
||||
|
||||
@@ -350,7 +348,7 @@ def run_once(round_label=""):
|
||||
price_info = prices.get(code)
|
||||
if not price_info:
|
||||
continue
|
||||
price, _ = price_info
|
||||
price, _, _ = price_info
|
||||
if price == 0:
|
||||
continue
|
||||
|
||||
@@ -430,11 +428,11 @@ def run_once(round_label=""):
|
||||
price_info = prices.get(code)
|
||||
if not price_info:
|
||||
continue
|
||||
price, _ = price_info
|
||||
price, _, _ = price_info
|
||||
if price == 0:
|
||||
continue
|
||||
|
||||
# 从 decisions.json 中读取 analysis 的买入区
|
||||
# 从 decisions (DB holding_strategies) 中读取 analysis 的买入区
|
||||
entry_low = d.get("entry_low", 0)
|
||||
entry_high = d.get("entry_high", 0)
|
||||
if not entry_low or not entry_high:
|
||||
@@ -486,7 +484,7 @@ def run_once(round_label=""):
|
||||
state[code]["__buy_zone"] = in_buy_zone
|
||||
state_updated = True
|
||||
|
||||
# 如果有重评过的股票,更新 decisions.json
|
||||
# 如果有重评过的股票,更新 DB holding_strategies(此前写入 decisions.json,已废弃)
|
||||
if reassesed_codes and HAS_REASSESS:
|
||||
try:
|
||||
# 重新 regenerate_all 只针对受影响的股票效率太低
|
||||
|
||||
Reference in New Issue
Block a user