diff --git a/data/mofin.db-shm b/data/mofin.db-shm deleted file mode 100644 index 5383233..0000000 Binary files a/data/mofin.db-shm and /dev/null differ diff --git a/data/mofin.db-wal b/data/mofin.db-wal deleted file mode 100644 index e78d615..0000000 Binary files a/data/mofin.db-wal and /dev/null differ diff --git a/data/portfolio.json b/data/portfolio.json index eaf0c06..31907d7 100644 --- a/data/portfolio.json +++ b/data/portfolio.json @@ -5,9 +5,9 @@ "name": "中际旭创", "shares": 100, "cost": 1316.53, - "price": 1135.18, + "price": 1136.12, "market_value": 113604.0, - "change_pct": -7.19, + "change_pct": -7.12, "currency": "CNY", "position_pct": 15.27, "_currency": "CNY" @@ -29,9 +29,9 @@ "name": "丘钛科技", "shares": 11000, "cost": 13.47, - "price": 5.99, + "price": 5.98, "market_value": 65890.0, - "change_pct": 0.729, + "change_pct": 0.583, "currency": "CNY", "position_pct": 7.97, "_currency": "CNY" @@ -41,9 +41,9 @@ "name": "紫金矿业", "shares": 2400, "cost": 39.89, - "price": 26.35, + "price": 26.34, "market_value": 63048.0, - "change_pct": 4.94, + "change_pct": 4.9, "currency": "CNY", "position_pct": 7.34, "_currency": "CNY" @@ -53,9 +53,9 @@ "name": "海博思创", "shares": 200, "cost": 266.95, - "price": 258.3, + "price": 259.0, "market_value": 51776.0, - "change_pct": -1.75, + "change_pct": -1.48, "currency": "CNY", "position_pct": 6.31, "_currency": "CNY" @@ -65,7 +65,7 @@ "name": "中芯国际", "shares": 300, "cost": 126.07, - "price": 146.32, + "price": 146.33, "market_value": 44112.0, "change_pct": -5.28, "currency": "CNY", @@ -77,9 +77,9 @@ "name": "建滔积层板", "shares": 500, "cost": 88.23, - "price": 72.83, + "price": 73.52, "market_value": 36415.0, - "change_pct": -15.28, + "change_pct": -14.473, "currency": "CNY", "position_pct": 5.28, "_currency": "CNY" @@ -101,9 +101,9 @@ "name": "宁德时代", "shares": 100, "cost": 401.78, - "price": 386.3, + "price": 386.01, "market_value": 38495.0, - "change_pct": 0.64, + "change_pct": 0.57, "currency": "CNY", "position_pct": 4.64, "_currency": "CNY" @@ -113,9 +113,9 @@ "name": "比亚迪股份", "shares": 600, "cost": 104.87, - "price": 68.41, + "price": 68.36, "market_value": 41070.0, - "change_pct": 8.903, + "change_pct": 8.834, "currency": "CNY", "position_pct": 4.62, "_currency": "CNY" @@ -125,9 +125,9 @@ "name": "万科企业", "shares": 19700, "cost": 4.67, - "price": 1.92, + "price": 1.93, "market_value": 38021.0, - "change_pct": 4.717, + "change_pct": 5.19, "currency": "CNY", "position_pct": 4.6, "_currency": "CNY" @@ -149,9 +149,9 @@ "name": "中芯国际", "shares": 500, "cost": 75.94, - "price": 69.88, + "price": 69.62, "market_value": 34635.0, - "change_pct": -9.843, + "change_pct": -10.179, "currency": "CNY", "position_pct": 4.2, "_currency": "CNY" @@ -161,9 +161,9 @@ "name": "长芯博创", "shares": 100, "cost": 231.46, - "price": 225.0, + "price": 226.07, "market_value": 22592.0, - "change_pct": -11.42, + "change_pct": -11.0, "currency": "CNY", "position_pct": 3.2, "_currency": "CNY" @@ -175,7 +175,7 @@ "cost": 12.19, "price": 8.45, "market_value": 20280.0, - "change_pct": 2.13, + "change_pct": 2.14, "currency": "CNY", "position_pct": 2.45, "_currency": "CNY" @@ -185,9 +185,9 @@ "name": "中科电气", "shares": 1400, "cost": 22.29, - "price": 14.33, + "price": 14.31, "market_value": 20062.0, - "change_pct": -0.76, + "change_pct": -0.9, "currency": "CNY", "position_pct": 2.42, "_currency": "CNY" @@ -209,9 +209,9 @@ "name": "法拉电子", "shares": 100, "cost": 147.18, - "price": 164.32, + "price": 164.3, "market_value": 16460.0, - "change_pct": -9.99, + "change_pct": -10.0, "currency": "CNY", "position_pct": 2.3, "_currency": "CNY" @@ -221,20 +221,20 @@ "name": "中国神华", "shares": 500, "cost": 45.89, - "price": 34.26, + "price": 34.13, "market_value": 17115.0, - "change_pct": 1.503, + "change_pct": 1.092, "currency": "CNY", "position_pct": 2.14, "_currency": "CNY" } ], - "total_assets": 902797.0, - "total_mv": 822321.0, + "total_assets": 903265.0, + "total_mv": 822789.0, "stock_value": null, "cash": 80476.0, "frozen_cash": 0.0, "position_pct": 91.09, "currency": "CNY", - "updated_at": "2026-07-02 13:46" + "updated_at": "2026-07-02 13:50" } \ No newline at end of file diff --git a/strategy_lifecycle.py b/strategy_lifecycle.py index 2e67654..5ff3d65 100644 --- a/strategy_lifecycle.py +++ b/strategy_lifecycle.py @@ -89,6 +89,23 @@ STRATEGY_QUALITY_GATES = [ "severity": "HIGH", "fix": "设置 d['currency']='HKD'" }, + # --- 第4条 CRITICAL 红线:9维交叉验证 (2026-07-02 Dad要求) --- + # 策略不能只有价格数字,必须有证据经过了多维分析: + # 横切面: 大盘+行业+个股 | 纵切面: 基本面+消息面+技术面+资金流 + # 代码层面可验证: sector_context(行业) + signal_factors(多因子) 或 tech_snapshot + { + "id": "GATE_9D_ANALYSIS", + "desc": "策略必须经过多维分析(sector_context + signal_factors)", + "check": lambda d: ( + bool(d.get("sector_context") and str(d.get("sector_context","")).strip() not in ("neutral","","N/A","-")) + and ( + bool(d.get("signal_factors") and isinstance(d.get("signal_factors"), (list,tuple)) and len(d["signal_factors"]) >= 1) + or bool(d.get("tech_snapshot") and any(c in str(d.get("tech_snapshot","")) for c in "支撑阻力压强")) + ) + ), + "severity": "CRITICAL", + "fix": "重新运行 reassess_with_context() 完整重评确保 sector_context/signal_factors/tech_snapshot 均已填充" + }, ]