feat: use playbook allocation_pct in position sizing (#172) #176

Merged
jihoson merged 1 commits from feature/issue-172-playbook-allocation-sizing into main 2026-02-20 08:37:59 +09:00
Collaborator

Summary

  • _determine_order_quantity()에 playbook_allocation_pct, scenario_confidence 파라미터 추가
  • AI가 지정한 allocation_pct가 있으면 변동성 스코어 기반 로직보다 우선 적용
  • confidence 보정: confidence/80 배율 적용 (80→1.0x, 96→1.2x), POSITION_MAX/MIN 범위 내로 클램핑
  • trading_cycle에서 matched_scenario.allocation_pct와 match.confidence를 _determine_order_quantity에 전달

Test plan

  • test_determine_order_quantity_uses_playbook_allocation_pct
  • test_determine_order_quantity_confidence_scales_allocation
  • test_determine_order_quantity_confidence_clamped_to_max
  • test_determine_order_quantity_fallback_when_no_playbook
  • 기존 61개 테스트 전체 통과

Closes #172

🤖 Generated with Claude Code

## Summary - _determine_order_quantity()에 playbook_allocation_pct, scenario_confidence 파라미터 추가 - AI가 지정한 allocation_pct가 있으면 변동성 스코어 기반 로직보다 우선 적용 - confidence 보정: confidence/80 배율 적용 (80→1.0x, 96→1.2x), POSITION_MAX/MIN 범위 내로 클램핑 - trading_cycle에서 matched_scenario.allocation_pct와 match.confidence를 _determine_order_quantity에 전달 ## Test plan - [x] test_determine_order_quantity_uses_playbook_allocation_pct - [x] test_determine_order_quantity_confidence_scales_allocation - [x] test_determine_order_quantity_confidence_clamped_to_max - [x] test_determine_order_quantity_fallback_when_no_playbook - [x] 기존 61개 테스트 전체 통과 Closes #172 🤖 Generated with [Claude Code](https://claude.com/claude-code)
agentson added 1 commit 2026-02-20 08:29:18 +09:00
feat: use playbook allocation_pct in position sizing (#172)
Some checks failed
CI / test (pull_request) Has been cancelled
c7640a30d7
- Add playbook_allocation_pct and scenario_confidence parameters to
  _determine_order_quantity() with playbook-based sizing taking priority
  over volatility-score fallback when provided
- Confidence scaling: confidence/80 multiplier (confidence 96 → 1.2x)
  clipped to [POSITION_MIN_ALLOCATION_PCT, POSITION_MAX_ALLOCATION_PCT]
- Pass matched_scenario.allocation_pct and match.confidence from
  trading_cycle so AI's allocation decisions reach order execution
- Add 4 new tests: playbook priority, confidence scaling, max clamp,
  and fallback behavior

Closes #172

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
jihoson merged commit 561faaaafa into main 2026-02-20 08:37:59 +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#176