From 198678cbd4f4265c3147598a04749f8b0c16a552 Mon Sep 17 00:00:00 2001 From: xxm Date: Sun, 16 Aug 2026 12:22:55 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20hk=5Fbacktest=E8=A1=A5mkt=5Fadx=5Fmax/m?= =?UTF-8?q?kt=5Frsi=5Fmin=E5=85=A5=E5=9C=BA=E5=AD=97=E6=AE=B5=E2=80=94?= =?UTF-8?q?=E2=80=94=E6=9E=81=E7=AB=AF=E6=80=A5=E8=B7=8C=E8=A7=84=E9=81=BF?= =?UTF-8?q?=E6=9D=A1=E4=BB=B6=E6=B5=8B=E8=AF=95=E6=94=AF=E6=8C=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- deploy/profile-scripts/hk_backtest.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/deploy/profile-scripts/hk_backtest.py b/deploy/profile-scripts/hk_backtest.py index 7c785c57..59eae541 100644 --- a/deploy/profile-scripts/hk_backtest.py +++ b/deploy/profile-scripts/hk_backtest.py @@ -69,6 +69,10 @@ def gen_trades_defensive(panel, strat, strike=3, cooldown_days=15): cond &= panel["mkt_ret20"] < e["mkt_ret20_max"] if "mkt_rsi_max" in e: cond &= panel["mkt_rsi"] < e["mkt_rsi_max"] + if "mkt_adx_max" in e: + cond &= panel["mkt_adx"] < e["mkt_adx_max"] + if "mkt_rsi_min" in e: + cond &= panel["mkt_rsi"] > e["mkt_rsi_min"] if "ret1_min" in e: cond &= panel["ret1"] > e["ret1_min"] if "ret5_min" in e: