feat(Core/UI): 백테스트 전역 엔진 선택 버튼 추가 및 스캘핑 Rust 방어로직 포팅 1차 완료

This commit is contained in:
Your Name
2026-09-03 02:49:14 +09:00
parent ac1190f1fc
commit 3b7c21cde4
316 changed files with 56952 additions and 1 deletions

View File

@@ -0,0 +1,33 @@
import re
html_path = "templates/backtest.html"
js_path = "static/js/backtest.js"
with open(html_path, "r", encoding="utf-8") as f:
html = f.read()
# The scalp box looks like: id="bt_ob_whip_ro_box"
# We need to insert tl_ob_whip_ro_box after tl_max_loss_krw or similar.
# Let's find <div class="row g-2 align-items-end mt-1"> for Tail defenses
# and insert before it.
tail_defense_marker = r'<!-- 방어 수치 -->'
# Let's find where to insert in Tail tab.
# <div class="tab-pane fade" id="tab-tail"> ... <!-- 방어 수치 -->
# Instead of complex regex, let's just tell the user to click "적용".
# But adding the box is good. Let's do it simply by reading the file, finding the marker in Tail tab.
with open(js_path, "r", encoding="utf-8") as f:
js = f.read()
# Replace the misleading alert
js = js.replace(
"'「백테 실행」으로 Optuna 숫자와 비교하세요.\\n(DB 저장 아님)'",
"'호가/휩쏘 등 후처리 파라미터는 DB 기반으로 동작합니다.\\n정확한 수익금 비교를 원하시면 Optuna 리스트에서 [적용(DB저장)]을 먼저 누른 후 백테스트를 실행하세요.'"
)
with open(js_path, "w", encoding="utf-8") as f:
f.write(js)
print("JS patched")