From c1b3830063780d8f5a02728c734c9013912654b9 Mon Sep 17 00:00:00 2001 From: xxm Date: Sun, 16 Aug 2026 17:57:41 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E9=80=89=E5=8F=82=E9=80=BB=E8=BE=91?= =?UTF-8?q?=E2=80=94=E2=80=94=E5=85=88=E8=83=9C=E7=8E=87=E2=89=A550%?= =?UTF-8?q?=E5=86=8D=E5=8F=96=E6=94=B6=E7=9B=8A=E6=9C=80=E9=AB=98(?= =?UTF-8?q?=E5=8E=9F=E5=8F=96=E6=94=B6=E7=9B=8A=E6=9C=80=E9=AB=98=E5=8F=AF?= =?UTF-8?q?=E8=83=BD=E9=80=89=E4=B8=AD=E4=BD=8E=E8=83=9C=E7=8E=87=E5=8F=82?= =?UTF-8?q?=E6=95=B0)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- evolution/b_group_miner.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/evolution/b_group_miner.py b/evolution/b_group_miner.py index e2c8d174..12527caa 100644 --- a/evolution/b_group_miner.py +++ b/evolution/b_group_miner.py @@ -151,12 +151,14 @@ def mine(market="a", regimes=None): verified = None if c is not None: # 多参数模拟验证,取最优 - best = None + # 先筛胜率≥50%的参数,再取其中收益最高(2026-08-16 修正:原取收益最高可能选中胜率<50%参数) + passed_params = [] for tp, sl, mh in [(20, 10, 40), (25, 10, 45), (30, 12, 50), (15, 8, 35)]: r = _simulate_verify(market, rg, panel, c, tp, sl, mh) - if r and (best is None or r[2] > best[2]): - best = (tp, sl, mh, *r) - if best: + if r and r[1] >= 50 and r[2] > 0: + passed_params.append((tp, sl, mh, *r)) + if passed_params: + best = max(passed_params, key=lambda x: x[5]) # (tp,sl,mh,tn,twr,tavg) -> tavg=index5 tp, sl, mh, tn, twr, tavg = best if twr >= 50 and tavg > 0: cand = {