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: