From b63fe3cf5f8209fcab4c811853ad4926b8894c3e Mon Sep 17 00:00:00 2001 From: xxm Date: Sun, 16 Aug 2026 13:08:19 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E8=BF=9B=E5=8C=96API=E8=BF=94=E5=9B=9E?= =?UTF-8?q?=E5=81=87=E8=AE=BE=E5=BD=92=E7=BA=B3+B=E7=BB=84=E5=80=99?= =?UTF-8?q?=E9=80=89+=E7=AD=96=E7=95=A5=E8=B5=84=E6=A0=BC=E6=A6=82?= =?UTF-8?q?=E8=A7=88=E2=80=94=E2=80=94=E7=95=8C=E9=9D=A2=E4=BD=93=E7=8E=B0?= =?UTF-8?q?=E5=90=8E=E5=8F=B0=E8=BF=9B=E5=8C=96=E6=9C=BA=E5=88=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- evolution/evolution_api.py | 40 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) diff --git a/evolution/evolution_api.py b/evolution/evolution_api.py index 435e071a..5a3d3fe9 100644 --- a/evolution/evolution_api.py +++ b/evolution/evolution_api.py @@ -72,6 +72,43 @@ def get_evolution_dashboard(): 'max_dd': pf.get('portfolio_max_dd_pct', 0), } + # ── 2026-08-16 数据归纳假设(方向一):每个激活策略的归纳优化假设 ── + hypotheses = [] + try: + sys.path.insert(0, '/home/hmo/MoFin/evolution') + from hypothesis_miner import induce_hypotheses + for v in _active_versions(): + mkt = 'hk' if v.startswith('hk') else 'a' + hs, _ = induce_hypotheses(v, mkt, period_tag='2y') + for h in hs[:3]: + hypotheses.append({ + 'strategy': v, 'market': mkt, **h, + }) + except Exception: + pass + + # ── 2026-08-16 B组候选(方向二):由果及因挖掘的候选策略 ── + b_group = [] + try: + import json as _j + p = _j.loads(open('/home/hmo/MoFin/data/b_group_candidates.json', encoding='utf-8').read()) + b_group = p.get('candidates', []) + except Exception: + pass + + # ── 2026-08-16 策略资格概览(研究Tab进化中心用)── + qual_overview = [] + try: + import sys as _sy + _sy.path.insert(0, '/home/hmo/MoFin/deploy/profile-scripts') + from strategy_qualify import evaluate_all_regimes, get_benchmarks + for v in _active_versions(): + mkt = 'hk' if v.startswith('hk') else 'a' + q = evaluate_all_regimes(v, mkt, bench=get_benchmarks(mkt)) + qual_overview.append({'strategy': v, 'market': mkt, 'qualification': q}) + except Exception: + pass + conn.close() return { @@ -79,6 +116,9 @@ def get_evolution_dashboard(): 'lessons': lessons, 'evolution': evolution, 'baseline': baseline, + 'hypotheses': hypotheses, + 'b_group': b_group, + 'qual_overview': qual_overview, }