feat: hk_backtest补mkt_adx_max/mkt_rsi_min入场字段——极端急跌规避条件测试支持

This commit is contained in:
xxm
2026-08-16 12:22:55 +08:00
parent 0a557d0430
commit 198678cbd4
+4
View File
@@ -69,6 +69,10 @@ def gen_trades_defensive(panel, strat, strike=3, cooldown_days=15):
cond &= panel["mkt_ret20"] < e["mkt_ret20_max"] cond &= panel["mkt_ret20"] < e["mkt_ret20_max"]
if "mkt_rsi_max" in e: if "mkt_rsi_max" in e:
cond &= panel["mkt_rsi"] < e["mkt_rsi_max"] 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: if "ret1_min" in e:
cond &= panel["ret1"] > e["ret1_min"] cond &= panel["ret1"] > e["ret1_min"]
if "ret5_min" in e: if "ret5_min" in e: