feat: use playbook allocation_pct in position sizing #172

Closed
opened 2026-02-20 08:23:40 +09:00 by agentson · 0 comments
Collaborator

문제

StockScenario.allocation_pct가 플레이북에 저장되지만 _determine_order_quantity()에서 완전 무시.
대신 스캐너 변동성 스코어만 사용. AI의 전략적 포지션 크기 결정이 실행에 반영되지 않음.

구현

_determine_order_quantity()에 파라미터 추가:

  • playbook_allocation_pct: float | None = None
  • scenario_confidence: int = 80

플레이북 allocation_pct가 있으면 우선 사용하고, confidence로 보정.
confidence 80 → 기본, confidence 95 → 1.19배 스케일.
POSITION_MAX_ALLOCATION_PCT/POSITION_MIN_ALLOCATION_PCT 범위 내로 클램핑.

테스트

  • test_determine_order_quantity_uses_playbook_allocation_pct
  • test_determine_order_quantity_confidence_scales_allocation
  • test_determine_order_quantity_fallback_when_no_playbook
## 문제 StockScenario.allocation_pct가 플레이북에 저장되지만 _determine_order_quantity()에서 완전 무시. 대신 스캐너 변동성 스코어만 사용. AI의 전략적 포지션 크기 결정이 실행에 반영되지 않음. ## 구현 _determine_order_quantity()에 파라미터 추가: - playbook_allocation_pct: float | None = None - scenario_confidence: int = 80 플레이북 allocation_pct가 있으면 우선 사용하고, confidence로 보정. confidence 80 → 기본, confidence 95 → 1.19배 스케일. POSITION_MAX_ALLOCATION_PCT/POSITION_MIN_ALLOCATION_PCT 범위 내로 클램핑. ## 테스트 - test_determine_order_quantity_uses_playbook_allocation_pct - test_determine_order_quantity_confidence_scales_allocation - test_determine_order_quantity_fallback_when_no_playbook
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: jihoson/The-Ouroboros#172