fix: run_mr_backtest tp_pct=None兜底默认0.18; evolution_api baseline改为v_weak/v_oversold, get_health_trend默认v_weak

This commit is contained in:
hmo
2026-08-12 00:53:47 +08:00
parent 614b4570d6
commit 38e4a5b160
2 changed files with 5 additions and 5 deletions
+2 -2
View File
@@ -2299,8 +2299,8 @@ def run_mr_backtest(strategy_version, start_date, end_date, capital=913000,
skip_stats['next_open'] += 1; i += 1; continue
# ── 出场(均值回归:让利润跑向止盈,无 MA20 截断)──
tp_pct = exit_cfg.get('tp_pct', 0.18)
sl_pct = exit_cfg.get('sl_pct', 0.08)
tp_pct = exit_cfg.get('tp_pct', 0.18) or 0.18 # None 时用默认 0.18
sl_pct = exit_cfg.get('sl_pct', 0.08) or 0.08
max_hold = exit_cfg.get('max_hold_days', 25)
target = ep * (1 + tp_pct)
stop = ep * (1 - sl_pct)