fix: Rust 파라미터 매핑 오류 및 순차 스터디 라벨 누락 수정

- tail_engine.py, breakout_engine.py: Rust엔진 연동 시 파라미터 키(sl_pct, tp_pct 등) 불일치 오류 수정
- optuna_mode_refine_runner.py: 다중 모드(seq) 1·2차 스터디명 생성 시 진입/돌파 모드(extra) 정보 추가하여 라벨 유실 방지
This commit is contained in:
Your Name
2026-09-03 08:19:36 +09:00
parent 3b7c21cde4
commit 7d351df583
3 changed files with 204 additions and 2 deletions

View File

@@ -238,7 +238,15 @@ def run_mode_refine(
env.pop("OPTUNA_GRID_NARROW_JSON", None)
p1_study_arg = str(phase1_study or "").strip()
p1_study = f"{strategy}_{mode}_refine1_{start.replace('-', '')}_{end.replace('-', '')}_{ts}"
extra = ""
if strategy == "tail" and entry_mode:
extra = f"_{entry_mode}"
elif strategy == "breakout":
from kis_trader.backtest.optuna_breakout_tpe_space import breakout_tpe_study_extra
extra = f"_{breakout_tpe_study_extra(sl_mode or 'fixed', ob_mode or 'off')}"
p1_study = f"{strategy}{extra}_{mode}_refine1_{start.replace('-', '')}_{end.replace('-', '')}_{ts}"
p1_log = ROOT / "logs" / f"optuna_refine1_{job_id}.log"
p1_json = str(phase1_json or "").strip()
@@ -331,7 +339,7 @@ def run_mode_refine(
state["narrow_path"] = str(narrow_path)
p2_trials = resolve_refine_phase2_trials(trials)
p2_study = f"{strategy}_{mode}_refine2_{start.replace('-', '')}_{end.replace('-', '')}_{ts}"
p2_study = f"{strategy}{extra}_{mode}_refine2_{start.replace('-', '')}_{end.replace('-', '')}_{ts}"
p2_log = ROOT / "logs" / f"optuna_refine2_{job_id}.log"
env2 = dict(env)
env2["OPTUNA_GRID_NARROW_JSON"] = str(narrow_path)