feat: 틱/호가 데이터 출처 표출 UI 추가 및 데이터 수집 개선

- 백테스트 및 실거래 시 틱과 호가의 벤더 출처(ob_source, entry_source) 기록 및 추적 강화 (tail_engine.py)
- 웹 UI '체결디버그'에 [틱:kis / 호가:ls] 형태로 데이터 출처를 직관적으로 표출 (backtest.js, backtest.html)
- LS WebSocket 구독 100건 제한 하드코딩 해제 및 env_config_ext 연동 (ls_ws.py)
- 기타 백테스트 웹 및 DB 관련 최적화 적용
This commit is contained in:
Your Name
2026-09-02 20:53:16 +09:00
parent 2c37771a16
commit 253c95e2c2
11 changed files with 1141 additions and 234 deletions

View File

@@ -259,6 +259,7 @@ def start_bt_job(
tick_exit: Optional[bool] = None,
orderbook_filter: str = "auto",
params_json: Optional[str] = None,
params_override: Optional[Dict[str, Any]] = None,
env_timeline: bool = False,
) -> Dict[str, Any]:
_ensure_dirs()
@@ -301,6 +302,14 @@ def start_bt_job(
result_json = RESULTS_DIR / f"{job_id}.json"
progress_file = _progress_path(job_id)
params_json_path = str(params_json or "").strip() or None
if params_override and isinstance(params_override, dict) and params_override:
pj_dir = ROOT / "logs" / "bt_job_params"
pj_dir.mkdir(parents=True, exist_ok=True)
pj = pj_dir / f"{job_id}_params.json"
pj.write_text(json.dumps(params_override, ensure_ascii=False), encoding="utf-8")
params_json_path = str(pj)
# tail 은 세밀 progress 있는 전용 CLI 우선
if strat == "tail" and TAIL_CLI.is_file():
cmd = [
@@ -318,8 +327,8 @@ def start_bt_job(
cmd.extend(["--tick-db", "1" if tick_db else "0"])
if tick_exit is not None:
cmd.extend(["--tick-exit", "1" if tick_exit else "0"])
if params_json:
cmd.extend(["--params-json", str(params_json)])
if params_json_path:
cmd.extend(["--params-json", str(params_json_path)])
if env_timeline:
cmd.append("--env-timeline")
if hist_src:
@@ -342,8 +351,8 @@ def start_bt_job(
cmd.extend(["--timeframe", str(int(timeframe))])
if tick_db is not None:
cmd.extend(["--tick-db", "1" if tick_db else "0"])
if params_json:
cmd.extend(["--params-json", str(params_json)])
if params_json_path:
cmd.extend(["--params-json", str(params_json_path)])
if env_timeline:
cmd.append("--env-timeline")
if hist_src: