Skip to content

feat(portfolio): introduce SleeveId as allocation key (RAD-67)#27

Merged
davison merged 2 commits intomainfrom
feature/rad-67-sleeve-allocation-key
Mar 29, 2026
Merged

feat(portfolio): introduce SleeveId as allocation key (RAD-67)#27
davison merged 2 commits intomainfrom
feature/rad-67-sleeve-allocation-key

Conversation

@davison
Copy link
Copy Markdown
Collaborator

@davison davison commented Mar 29, 2026

Summary

  • Introduces SleeveId = NewType("SleeveId", str) and optional sleeve_name on StrategySpec
  • RiskAllocationPolicy.allocate() now takes Mapping[SleeveId, Instrument]Mapping[SleeveId, float], preserving the instrument lookup path for performance-weighted policies
  • PortfolioRunner.strategies keyed by SleeveId; on_candle_close() fans out to all sleeves matching the instrument
  • Reconciliation derives instrument from str(s.instrument) (not the sleeve key) — IG positions remain unaffected
  • Fixes the silent collision where two sleeves on the same instrument (e.g. AdaptiveFade AUDCAD + BollingerReversion AUDCAD) overwrote each other in the strategies dict

Test plan

  • uv run mypy --strict on changed files — 0 errors
  • uv run ruff check on changed files — 0 errors
  • uv run pytest tests/portfolio/test_policy.py — pass
  • Full suite: 587/587 pass
  • QA approval from Testy (commit 035d2c4)

Related

Closes RAD-67. Parent: RAD-37.

🤖 Generated with Claude Code

Cody (Radius Red) and others added 2 commits March 26, 2026 17:04
- Update README.md with correct install flow, public package surface,
  and Dukascopy-cache backtest entry points
- Fix stale module paths across aggregation_guide, backtesting_guide,
  metrics_guide, risk_management, and strategy_guide

Co-Authored-By: Paperclip <[email protected]>
…-aware policy lookup (RAD-67)

- Added SleeveId NewType and sleeve_name field on StrategySpec
- RiskAllocationPolicy.allocate() signature changed from list[SleeveId] to
  Mapping[SleeveId, Instrument] so policies resolve actual instrument history
- PortfolioRunner._apply_risk_budgets() builds sleeve->instrument mapping
- PortfolioRunner.strategies keyed by SleeveId; on_candle_close fans out to
  all sleeves matching the instrument
- Reconciliation derives epic from str(instrument), not sleeve key
- All portfolio tests updated

Co-Authored-By: Paperclip <[email protected]>
@davison davison merged commit 8c0569e into main Mar 29, 2026
5 checks passed
@davison davison deleted the feature/rad-67-sleeve-allocation-key branch March 29, 2026 12:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant