fix: 全面系统修复 — delivery目标修正 + 脚本同步 + refresh_mtf_cache import修复 + clean_watchlist硬编码修复

修复清单:
- cron delivery修正:10个job从deliver=origin/all改为local,消除推送错误
- refresh_mtf_cache.py:替换strategy_lifecycle.PORTFOLIO_PATH导入为mofin_db直接读DB
- clean_watchlist.py:修复mo_data导入名错误和JSON硬编码路径
- MoFin/scripts/与profile scripts互相补全,双向sync到一致
- price_monitor.py:现金源从portfolio_summary表改为cash_log(Dad确认的现金权威)
- 更新watchlist.json加入000850华茂股份
This commit is contained in:
知微
2026-07-06 14:01:54 +08:00
parent 3e2f0315eb
commit 66962ae190
62 changed files with 23364 additions and 83 deletions
+20 -11
View File
@@ -22,20 +22,29 @@ def log(msg):
print(f"[{ts}] {msg}", file=sys.stderr)
def main():
from strategy_lifecycle import safe_json_load, PORTFOLIO_PATH, WATCHLIST_PATH
from mofin_db import get_conn
# 收集所有股票代码
codes = []
for item in safe_json_load(PORTFOLIO_PATH, {}).get("holdings", []):
code = item.get("code", "")
if code:
codes.append(("portfolio", code))
seen = set(c[1] for c in codes)
for item in safe_json_load(WATCHLIST_PATH, {}).get("stocks", []):
code = item.get("code", "")
if code and code not in seen:
codes.append(("watchlist", code))
seen.add(code)
seen = set()
conn = get_conn()
try:
rows = conn.execute("SELECT code FROM holdings WHERE is_active=1").fetchall()
for r in rows:
code = r["code"]
if code:
codes.append(("portfolio", code))
seen.add(code)
rows = conn.execute("SELECT code FROM watchlist_stocks WHERE is_active=1").fetchall()
for r in rows:
code = r["code"]
if code and code not in seen:
codes.append(("watchlist", code))
seen.add(code)
finally:
conn.close()
# 加入指数代码(用于多周期趋势研判)
INDEXES = {