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

@@ -26,6 +26,7 @@ LIVE_STRATEGY_LABELS: Dict[str, str] = {
"RANGE_BREAK": "박스권돌파",
"UPDOW": "UPDOWN 박스",
"DBBAND": "더블BB",
"DART": "DART 수주",
}
# 전략 ID → 실제 env 키 (SHORT 는 TAIL_* 가 canonical — tail_engine·config_short)
@@ -476,6 +477,24 @@ def build_live_config_groups() -> List[GroupDef]:
_f("PENDING_SELL_STOP_MAX_AGE_SEC", "손절 매도 미체결 만료(초)", "int", default=15),
_f("SELL_PENDING_REORDER_ON_EXPIRE", "손절 만료 후 즉시 재매도", "bool", default=True),
_f("AUTO_CANCEL_PARTIAL_BUY_REMAINDER", "부분체결 잔량 자동취소", "bool", default=True),
_f(
"SELL_LIMIT_CANCEL_BEFORE_MARKET_RETRY",
"익절지정가→시장가 전 취소",
"bool",
default=True,
hint=(
"ON=지정가 미확인/부분체결 시 잔여 취소 후 ODNO 재조회, "
"취소실패·미확정이면 시장가 금지(PENDING) · "
"OFF=레거시 즉시 시장가(이중매도 위험) · 전전략 OrderManager 공통"
),
),
_f(
"SELL_LIMIT_RECHECK_WAIT_SEC",
"지정가 취소 후 재조회(초)",
"int",
default=1,
hint="SELL_LIMIT_CANCEL_BEFORE_MARKET_RETRY=ON 일 때 ODNO 재조회 대기",
),
],
})
@@ -595,6 +614,21 @@ def build_live_config_groups() -> List[GroupDef]:
],
})
groups.append({
"id": "scalp_exit",
"title": "스캘핑(SCALP) — EOD",
"hint": (
"config_scalp · 저장 후 다음 매도 루프부터 반영(재시작 권장). "
"실매 기존 하드코딩 15:25 장마감청산과 동일 기본값."
),
"fields": [
_f("SCALP_EOD_ENABLED", "EOD 당일청산 사용", "bool", default=True,
hint="ON=설정 시각 이후 보유 전량 장마감청산 · OFF=익절·손절·어깨만"),
_f("SCALP_EOD_HM", "EOD 시각 (HH:MM)", "text", default="15:25",
hint="실매 기존 15:25 · 정규장 15:30 마감 직전 순차매도"),
],
})
groups.append({
"id": "breakout_exit",
"title": "돌파(BREAKOUT) — EOD·시간컷",
@@ -685,6 +719,16 @@ def build_live_config_groups() -> List[GroupDef]:
hint="예: BREAKOUT EOD 15:15 → 15:08 실행 · REST 잔고 1회/일"),
_f("GHOST_PURGE_ON_RECONCILE", "고아복구 시 유령잔고 삭제", "bool", default=True,
hint="ON=브로커 0주인데 active_trades 남은 종목 삭제(수동보호 제외) · Pre/Post EOD 동일 잔고조회에서 처리"),
_f(
"GHOST_PURGE_RECORD_HISTORY",
"유령정리 시 거래내역 기록",
"bool",
default=True,
hint=(
"ON=유령 삭제 시 trade_history 에 sell_reason=ghost_purge "
"(realized_pnl=0) · OFF=삭제만 · 전전략 공통"
),
),
_f("INTRADAY_HOLDINGS_DRIFT_ENABLED", "장중 qty 드리프트 감시", "bool", default=False,
hint="기본 OFF · ON=N분마다 잔고 REST · 알림/자동복구는 별도 키"),
_f("INTRADAY_HOLDINGS_DRIFT_INTERVAL_SEC", "드리프트 조회주기(초)", "int", default=300,