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:
@@ -41,6 +41,32 @@ def resolve_universe_exit_debounce_sec(
|
||||
return max(0, int(default_when_no_grace))
|
||||
|
||||
|
||||
# strategy_id → (전략별 오버라이드 env 키, CONDITION_EXIT_GRACE=0 일 때 폴백)
|
||||
# 웹·Optuna·resolve_*_universe 가 이 맵만 쓰면 debounce=0 특수케이스가 사라진다.
|
||||
_STRATEGY_UNIVERSE_EXIT_DEBOUNCE: Dict[str, Tuple[Optional[str], int]] = {
|
||||
"SCALP": ("SCALP_UNIVERSE_EXIT_DEBOUNCE_SEC", 0),
|
||||
"MOMENTUM": ("MOMENTUM_UNIVERSE_EXIT_DEBOUNCE_SEC", 30), # 모멘텀 기존 폴백 30 유지
|
||||
"BREAKOUT": ("BREAKOUT_UNIVERSE_EXIT_DEBOUNCE_SEC", 0),
|
||||
"SHORT": ("TAIL_UNIVERSE_EXIT_DEBOUNCE_SEC", 0),
|
||||
"TAIL": ("TAIL_UNIVERSE_EXIT_DEBOUNCE_SEC", 0),
|
||||
"RANGE_BREAK": ("RANGE_BREAK_UNIVERSE_EXIT_DEBOUNCE_SEC", 0),
|
||||
}
|
||||
|
||||
|
||||
def universe_exit_debounce_sec_for_strategy(strategy_id: str) -> int:
|
||||
"""전략 공통 — history 슬롯·타임라인 EXIT 디바운스 초.
|
||||
|
||||
우선순위: ``{STRATEGY}_UNIVERSE_EXIT_DEBOUNCE_SEC`` → ``CONDITION_EXIT_GRACE_SEC``
|
||||
→ 전략별 폴백(모멘텀만 30, 나머지 0).
|
||||
"""
|
||||
sid = str(strategy_id or "").strip().upper()
|
||||
key, dflt = _STRATEGY_UNIVERSE_EXIT_DEBOUNCE.get(sid, (None, 0))
|
||||
return resolve_universe_exit_debounce_sec(
|
||||
strategy_env_key=key,
|
||||
default_when_no_grace=dflt,
|
||||
)
|
||||
|
||||
|
||||
def _event_time_to_key(event_time: str) -> str:
|
||||
et = str(event_time or "")
|
||||
if len(et) < 19:
|
||||
|
||||
Reference in New Issue
Block a user