portfolio
Run multi-holding cohort analysis to rank tail contributors by weight times p10, or get per-symbol track records with historical pattern accuracy.
Instructions
Portfolio-level analysis OR per-symbol track-record + Layer 5 memory.
Two modes:
mode="basic" (default):
Multi-holding conditional distribution. Runs per-holding cohorts
in parallel, weight-averages the distributions, ranks tail
contributors (weight × p10, most negative first). PM-agent
primitive. Pass holdings=[{symbol, weight, date}].
mode="symbol_intel":
Per-symbol track record + Layer 5 memory — what does Chart
Library know about this single symbol across all prior
analyses? Returns prior cohort_observations, feature_reliability
learned for the symbol, and the symbol's per-pattern accuracy
history. Pass symbol=X, lookback_days=N.
Args:
holdings: list of {symbol, weight, date} (mode="basic")
symbol: ticker (mode="symbol_intel")
mode: "basic" | "symbol_intel"
horizons: forward horizons (mode="basic"; default [5, 10])
top_k_per_holding: cohort size per holding (mode="basic")
include_path_stats: include MAE/MFE (mode="basic"; slower)
lookback_days: history window (mode="symbol_intel"; default 365)Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| holdings | No | ||
| symbol | No | ||
| mode | No | basic | |
| horizons | No | ||
| top_k_per_holding | No | ||
| include_path_stats | No | ||
| lookback_days | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |