Skip to content

做什么(One-liner)

Canvas 牛市 Agent:2 步调用trader-select 根据 regime 算 bull/bear 权重;dual-agent-simulate 用 bull (SPY+QQQ) × bear (TLT+GLD) 月频模拟。UI 展示 bull_weight + total_return + Sharpe。

怎么用

macro_snapshot_v1 → bull_agent_v1  (regime=expansion, n_periods=12)
                                   → weight=0.65, total_return=8.2%, Sharpe=1.3

常与 bear_agent_v1 并用:

       ┌─ bull_agent_v1 (weight=0.65)
regime ┤
       └─ bear_agent_v1 (weight=0.35)

核心公式

POST /casa/trader-select {regime, w?, cli?, cycle_phase?}
  → bull_weight, bear_weight (sum=1), strategy_bias, reasoning

POST /casa/dual-agent-simulate {regime, n_periods=12, initial_capital=1M}
  → simulate portfolio = bull_w × (SPY 40% + QQQ 60%) + bear_w × (TLT 60% + GLD 40%)
  → history (每月) + summary {final_value, total_return_pct, Sharpe, max_drawdown_pct}

bull_agent_v1 extracts: {weight: bull_weight, total_return, sharpe, max_drawdown, ...}
bear_agent_v1 extracts: {weight: bear_weight, ...}

假设与适用场景

假设:monthly 频率 + bull/bear 组合固定 (SPY+QQQ, TLT+GLD) + rule-based weights + fallback seed 42。

适用:Canvas 策略图跨资产 allocation scenario、bull vs bear 对比、regime rotation demo。

不适用:实时 trading、custom portfolio、非美国、leverage 优化。

输入 / 输出契约

{regime?, w_current?, cli_direction?, cycle_phase?, n_periods?=12}{agent_type='bull', weight, strategy_bias, reasoning, regime, total_return, sharpe, max_drawdown}

已知局限

  1. 硬编码 tickers (SPY/QQQ/TLT/GLD)
  2. Monthly 频率
  3. Rule-based weights (不是 ML)
  4. Fallback 分布不同于 yfinance real
  5. Fallback seed=42 硬编码
  6. No intra-portfolio rebalancing
  7. symmetric with bear_agent_v1 (共享 2 次调用;UI 提取字段不同)

参考文献

Faber (2007) Tactical Asset Allocation + Pangura Internal Rulebook。详见 frontmatter。

Golden Test

共享 2 个 fixtures:

  • tests/golden/fixtures/tier4/casa_trader_select/ — 16 rule branches + 6 contract tests
  • tests/golden/fixtures/tier4/casa_dual_agent/ — 6 fallback-path scenarios + 5 contract tests

17 tests 合计

Changelog

  • 1.0.0 (2026-04-21) — 首次 Active(Tier 4 batch 1.2;姐妹 operator bear_agent_v1)

Verifiable intelligence for the decisions that demand scrutiny.