[BACKTEST-MODEL] TKT-P1-003 Triple Barrier 라벨러 구현 #286

Merged
agentson merged 2 commits from feature/issue-tkt-p1-003-triple-barrier-labeler into feature/v3-session-policy-stream 2026-02-27 00:47:37 +09:00
Collaborator

목적/범위

  • Triple Barrier 라벨러를 신규 추가해 first-touch 기반 +1/-1/0 라벨 생성 구현
  • Long/Short 방향 지원 및 동시 터치 tie-break 정책 기본값(보수적 stop_first) 제공

시나리오/분류

  • [BACKTEST-MODEL]

추적 ID 매핑

Type IDs
REQ REQ-V2-005
TASK TASK-V2-007, TASK-CODE-004
TEST TEST-ACC-012

구현 내용

  • src/analysis/triple_barrier.py
    • TripleBarrierSpec, TripleBarrierLabel
    • label_with_triple_barrier() 구현 (upper/lower/time barrier 선터치 라벨링)
  • tests/test_triple_barrier.py
    • upper-first, lower-first, timeout, tie-break, short-side 반전 케이스 검증

검증 증적

  • pytest -q tests/test_triple_barrier.py -> 5 passed
  • pytest -q -> 916 passed
  • 런타임: timeout 15s python3 -m src.main --mode paper
    • 기동/종료 정상
    • 환경 특이사항: EGW02004(실전투자 TR 불일치) 반복

Closes #285

## 목적/범위 - Triple Barrier 라벨러를 신규 추가해 first-touch 기반 `+1/-1/0` 라벨 생성 구현 - Long/Short 방향 지원 및 동시 터치 tie-break 정책 기본값(보수적 stop_first) 제공 ## 시나리오/분류 - `[BACKTEST-MODEL]` ## 추적 ID 매핑 | Type | IDs | | --- | --- | | REQ | `REQ-V2-005` | | TASK | `TASK-V2-007`, `TASK-CODE-004` | | TEST | `TEST-ACC-012` | ## 구현 내용 - `src/analysis/triple_barrier.py` - `TripleBarrierSpec`, `TripleBarrierLabel` - `label_with_triple_barrier()` 구현 (upper/lower/time barrier 선터치 라벨링) - `tests/test_triple_barrier.py` - upper-first, lower-first, timeout, tie-break, short-side 반전 케이스 검증 ## 검증 증적 - `pytest -q tests/test_triple_barrier.py` -> `5 passed` - `pytest -q` -> `916 passed` - 런타임: `timeout 15s python3 -m src.main --mode paper` - 기동/종료 정상 - 환경 특이사항: EGW02004(실전투자 TR 불일치) 반복 Closes #285
agentson added 1 commit 2026-02-27 00:45:30 +09:00
agentson added 1 commit 2026-02-27 00:47:10 +09:00
Author
Collaborator

[Reviewer Agent] short-side 동시터치 tie-break 버그 및 테스트 공백 재검토 완료. 최신 커밋에서 해소됨. Ready for verifier: YES.

[Reviewer Agent] short-side 동시터치 tie-break 버그 및 테스트 공백 재검토 완료. 최신 커밋에서 해소됨. Ready for verifier: YES.
Author
Collaborator

[Dev Agent] 리뷰 반영: short-side tie-break semantics 수정(stop_first=>stop_loss, take_first=>take_profit), 회귀 테스트(test_short_tie_break_modes) 추가. 검증: tests/test_triple_barrier.py 6 passed, full pytest 917 passed.

[Dev Agent] 리뷰 반영: short-side tie-break semantics 수정(stop_first=>stop_loss, take_first=>take_profit), 회귀 테스트(test_short_tie_break_modes) 추가. 검증: tests/test_triple_barrier.py 6 passed, full pytest 917 passed.
Author
Collaborator

[Runtime Verifier] 티켓 코드 변경은 연구 모듈(라벨러) 중심으로 실행루프 영향 없음. 증적: timeout 15s python3 -m src.main --mode paper 기동/종료 정상 확인. 환경 특이사항(EGW02004) 지속 관측.

[Runtime Verifier] 티켓 코드 변경은 연구 모듈(라벨러) 중심으로 실행루프 영향 없음. 증적: timeout 15s python3 -m src.main --mode paper 기동/종료 정상 확인. 환경 특이사항(EGW02004) 지속 관측.
Author
Collaborator

[Verifier Agent] 검증 계획 기준 PASS. 요구사항 범위(REQ-V2-005) 충족, 테스트 통과(단위+전체), 런타임 모니터링 증적 확인. Verification 승인.

[Verifier Agent] 검증 계획 기준 PASS. 요구사항 범위(REQ-V2-005) 충족, 테스트 통과(단위+전체), 런타임 모니터링 증적 확인. Verification 승인.
agentson merged commit a93a5c616b into feature/v3-session-policy-stream 2026-02-27 00:47:37 +09:00
Sign in to join this conversation.
No Reviewers
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: jihoson/The-Ouroboros#286