From 9269b220d891106f16d73d2fc7c71adbe7ca6c14 Mon Sep 17 00:00:00 2001 From: hmo Date: Sat, 15 Aug 2026 04:14:26 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20strategy=5Frouter=E6=B8=AF=E8=82=A1?= =?UTF-8?q?=E8=B7=AF=E7=94=B1=E7=94=A8hk=5Fstrategies=E6=B8=A9=E5=8C=BA?= =?UTF-8?q?=E7=BB=84=E5=90=88(=E6=9B=BF=E4=BB=A3strategy=5Fregime=5Fperf?= =?UTF-8?q?=E6=9C=BA=E5=88=B6),=E6=8C=89=E6=B8=A9=E5=8C=BA=E6=BF=80?= =?UTF-8?q?=E6=B4=BB=E5=AF=B9=E5=BA=94=E7=AD=96=E7=95=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- deploy/profile-scripts/strategy_router.py | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/deploy/profile-scripts/strategy_router.py b/deploy/profile-scripts/strategy_router.py index 753565d5..12fa6d6f 100644 --- a/deploy/profile-scripts/strategy_router.py +++ b/deploy/profile-scripts/strategy_router.py @@ -157,20 +157,18 @@ def main(): "updated_at": datetime.now().strftime("%Y-%m-%d %H:%M:%S"), "note": "温区(平滑K=5)选策略类型 + 温度(rsi)乘数;策略全温区发信号,适用温区由实测动态决定", } - # 港股路由(2026-08-14 新增,不影响A股)——港股策略按港股温区激活 + # 港股路由(2026-08-14 新增,不影响A股)——港股组合按温区调度(hk_strategies 定义) try: hk_regime = load_regime('hk') hk_temp = load_temp('hk') - hk_perf = load_regime_perf('hk') - if hk_perf: - hk_weights = route(hk_regime, hk_temp, hk_perf) - out["markets"] = {"hk": { - "state": hk_regime.get("regime", "unknown"), - "state_date": hk_regime.get("date", ""), - "temp_band": hk_temp.get("band", "unknown"), - "weights": hk_weights, - "active": [k for k, v in hk_weights.items() if v["matched"]], - }} + from hk_strategies import strategies_for_regime + hk_active = strategies_for_regime(hk_regime.get("regime", "unknown")) + out["markets"] = {"hk": { + "state": hk_regime.get("regime", "unknown"), + "state_date": hk_regime.get("date", ""), + "temp_band": hk_temp.get("band", "unknown"), + "active": hk_active, + }} except Exception as e: print(f"港股路由失败(不影响A股): {e}", flush=True) OUT.write_text(json.dumps(out, ensure_ascii=False, indent=1), encoding="utf-8")