migrate: live_prices+mtf+capital_flow DB read/write, cleanup remaining JSON refs

This commit is contained in:
知微
2026-07-03 13:46:12 +08:00
parent bb9b3922c9
commit 5bd8af20ac
6 changed files with 44 additions and 46 deletions
+3 -6
View File
@@ -989,7 +989,7 @@ def reassess_strategy(code, name, price, cost, shares, current_action,
time_horizon = "2周~3月"
position_advice = "中等仓位"
try:
mtf_cache = json.load(open("/home/hmo/web-dashboard/data/multi_tf_cache.json"))
mtf_cache = mtf._load_mtf_cache()
stock_data = mtf_cache.get(code, {})
daily_klines = stock_data.get("daily", [])
fund = stock_data.get("fundamentals", {})
@@ -1537,11 +1537,8 @@ def load_stock_news_sentiment(code):
def load_fundamentals(code):
"""加载个股基本面"""
try:
path = "/home/hmo/web-dashboard/data/multi_tf_cache.json"
if not os.path.exists(path):
return {}
m = json.load(open(path))
return m.get(code, {}).get("fundamentals", {}) or {}
cache = mtf._load_mtf_cache()
return cache.get(code, {}).get("fundamentals", {}) or {}
except Exception:
return {}