migrate: live_prices+mtf+capital_flow DB read/write, cleanup remaining JSON refs
This commit is contained in:
@@ -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 {}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user