refactor: 统一价格入口 mo_data.get_price() - 22个脚本移除自拉腾讯API
所有价格获取统一走 mo_data.get_price() / get_prices_batch():
- 优先读 live_prices(DB) → 无/过期才调 stock_quote(API) → 自动写回DB
- 22个脚本全部替换:branch_scanner chip_factors divergence_detector
market_screener mo_provider mofin_collect monitor_300308 300308_monitor
multi_timeframe refresh_macro_context stale_detector stale_push_wlin
stock_profile strategy_evaluator strategy_lifecycle strategy_review
strategy-staleness-check technical_analysis xiaoguo_signal_consumer
collect_evaluation_data
This commit is contained in:
@@ -12,8 +12,8 @@ pre-flight-check.py — 策略上线前检查清单的自动化部分
|
||||
|
||||
依赖:
|
||||
- /home/hmo/projects/MoFin/data/prompts/registry.json(版本一致性)
|
||||
- /home/hmo/web-dashboard/data/decisions.json(策略+成本)
|
||||
- /home/hmo/web-dashboard/data/portfolio.json(持仓数据)
|
||||
- mofin.db: holding_strategies 表(策略+成本)
|
||||
- mofin.db: holdings + holding_strategies 表(持仓+策略数据)
|
||||
|
||||
输出格式:
|
||||
✅ 项目名 — 通过
|
||||
@@ -90,11 +90,11 @@ def check_data_freshness():
|
||||
|
||||
# === 检查 5:成本有效 ===
|
||||
def check_cost_validity():
|
||||
"""检查 decisions.json 中所有持仓的成本是否有效"""
|
||||
"""检查所有持仓的成本是否有效"""
|
||||
try:
|
||||
dec = read_decisions()
|
||||
except Exception as e:
|
||||
return ("⚠️ 成本有效性", f"无法读取 decisions: {e}")
|
||||
return ("⚠️ 成本有效性", f"无法读取策略数据: {e}")
|
||||
|
||||
stocks = dec.get("stocks", dec.get("holdings", dec.get("strategies", [])))
|
||||
if not stocks:
|
||||
@@ -130,7 +130,7 @@ def check_stop_technical(code):
|
||||
try:
|
||||
dec = read_decisions()
|
||||
except Exception as e:
|
||||
return ("⚠️ 止损技术位", f"无法读取 decisions: {e}")
|
||||
return ("⚠️ 止损技术位", f"无法读取策略数据: {e}")
|
||||
|
||||
stocks = dec.get("stocks", dec.get("strategies", []))
|
||||
for s in stocks:
|
||||
@@ -149,7 +149,7 @@ def check_stop_technical(code):
|
||||
f"检查是否用了固定百分比而非技术位")
|
||||
return ("✅ 止损技术位", f"{code} 止损{stop},需要人工确认是否基于支撑位")
|
||||
|
||||
return ("⚠️ 止损技术位", f"代码 {code} 未在 decisions.json 中找到")
|
||||
return ("⚠️ 止损技术位", f"代码 {code} 未在策略数据中找到")
|
||||
|
||||
|
||||
# === 检查 4(单股):R/R 达标 ===
|
||||
@@ -158,7 +158,7 @@ def check_rr(code, price=None):
|
||||
try:
|
||||
dec = read_decisions()
|
||||
except Exception as e:
|
||||
return ("⚠️ R/R 达标", f"无法读取 decisions: {e}")
|
||||
return ("⚠️ R/R 达标", f"无法读取策略数据: {e}")
|
||||
|
||||
stocks = dec.get("stocks", dec.get("strategies", []))
|
||||
for s in stocks:
|
||||
@@ -186,7 +186,7 @@ def check_rr(code, price=None):
|
||||
else:
|
||||
return ("❌ R/R 达标", f"{code} R/R={rr:.2f} < {min_rr}")
|
||||
|
||||
return ("⚠️ R/R 达标", f"代码 {code} 未在 decisions.json 中找到")
|
||||
return ("⚠️ R/R 达标", f"代码 {code} 未在策略数据中找到")
|
||||
|
||||
|
||||
def main():
|
||||
|
||||
Reference in New Issue
Block a user