feat: Add DART strategy and related configurations

ㅇ
Changes:
- Introduced the DART strategy to the trading system, including its configuration and integration into the existing framework.
- Updated the database schema to include DART-specific tables for disclosures and watchlists.
- Enhanced the backtesting and parameter search functionalities to support the DART strategy.
- Implemented new rules for browser verification and API interactions to ensure compliance with the updated DART strategy.

Impact:
- These additions expand the trading capabilities of the system, allowing for more comprehensive analysis and execution of DART-related strategies, while maintaining system integrity and performance.
This commit is contained in:
Your Name
2026-07-21 07:50:24 +09:00
parent 74db49149f
commit 61bec4bd1d
86 changed files with 4811 additions and 297 deletions

View File

@@ -54,18 +54,15 @@ def momentum_universe_exit_debounce_sec() -> int:
(overnight→장초 wipe / 단발 EXIT 노이즈 정합).
``MOMENTUM_UNIVERSE_EXIT_DEBOUNCE_SEC`` 가 있으면 그 값 우선(0=OFF).
"""
from kis_trader.backtest.universe_timeline import resolve_universe_exit_debounce_sec
from kis_trader.backtest.universe_timeline import universe_exit_debounce_sec_for_strategy
return resolve_universe_exit_debounce_sec(
strategy_env_key="MOMENTUM_UNIVERSE_EXIT_DEBOUNCE_SEC",
default_when_no_grace=30,
)
return universe_exit_debounce_sec_for_strategy("MOMENTUM")
def momentum_backtest_candle_warmup_bars() -> int:
"""백테 지표 warm-up — 실매 ``get_candles(50)`` 과 동일하게 전일·당일 장전 봉 선행."""
"""백테 지표·E(전일시가) warm-up — 실매 갭보정(~500)과 맞춰 전일 장시작까지 덮음."""
from kis_trader.utils.env import get_env_int
return max(0, int(get_env_int("MOMENTUM_BACKTEST_CANDLE_WARMUP_BARS", 50)))
return max(0, int(get_env_int("MOMENTUM_BACKTEST_CANDLE_WARMUP_BARS", 400)))
def prepend_momentum_candle_warmup(
@@ -126,15 +123,13 @@ _REST_WARMUP_PREFIX_CACHE: Dict[Tuple[str, str], List[Dict[str, Any]]] = {}
def _momentum_rows_have_prev_day(rows: List[Dict], period_day: str) -> bool:
"""기간 시작일 이전 분봉이 있으면 HTS E(전일시가) 해석 가능."""
pd = str(period_day or "")[:8]
if not pd:
return True
for r in rows or []:
ct = str(r.get("candle_time") or "")
if len(ct) >= 8 and ct[:8] < pd:
return True
return False
"""기간 시작일 기준 직전 거래일 **장시작 시가** 봉이 있으면 HTS E 해석 가능.
전일 오후 봉만 있는 경우(웜업 50 등)는 False → REST 웜업으로 보강.
"""
from kis_trader.engine.momentum_hts_logic import candles_have_prev_session_open
return candles_have_prev_session_open(rows or [], str(period_day or "")[:8])
def _kiwoom_gap_credentials() -> Tuple[str, str, bool]: