8-k-scanner
Scan SEC 8-K disclosures across a single ticker or a watchlist using Massive's pre-parsed disclosure taxonomy. Groups the underlying rows by filing (one 8-K…
Monte Carlo forward P&L simulator for a book. Simulates 10,000 correlated return trajectories from the shrunk covariance matrix over a caller-specified horizon (default 60 trading days) and reports the full cumulative-return distribution, max-drawdown distribution, path VaR, and
$ npx -y skills add rgourley/quant-garage --skill mc-portfolio-simulator --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
/mc-portfolio-simulatorContext preview
The summary Claude sees to decide when to auto-load this skill.
Monte Carlo forward P&L simulator for a book. Simulates 10,000 correlated return trajectories from the shrunk covariance matrix over a caller-specified horizon (default 60 trading days) and reports the full cumulative-return distribution, max-drawdown distribution, path VaR, and
name: mc-portfolio-simulator description: Monte Carlo forward P&L simulator for a book. Simulates 10,000 correlated return trajectories from the shrunk covariance matrix over a caller-specified horizon (default 60 trading days) and reports the full cumulative-return distribution, max-drawdown distribution, path VaR, and P(loss > X%) at 5/10/20/30% thresholds. Companion to position-sizer. Requires Stocks Basic. Runs on the free tier.
You hand over a book (weights per ticker) and a horizon. The skill fits the covariance matrix on the historical window, simulates N correlated return trajectories forward, and reports the distribution of outcomes.
Companion to `position-sizer` and to `risk-report --mc`. Same math underneath: shrunk correlation × per-name vols → covariance → Cholesky-factored path simulation. The three tools differ in framing:
drawdown, stress days.
have weights, you want the P&L distribution.
outcome?"
full risk-report output
"P(loss > 10%)", "forward P&L distribution"
Not for: predicting the direction (MC doesn't pick winners; it fans the future out). Not for options portfolios (payoffs are non-linear; this simulates linear returns).
Optional:
distribution. student_t gives fatter tails.
Two output layers from one run.
**Layer 1: canonical JSON** matching [`output-schema.json`](./output-schema.json). `cumulative_return_distribution` with mean, std, and p5/p10/p25/p50/p75/p90/p95. `max_drawdown_distribution` with p5/p10/p25/p50/p75 (all negative). `path_var_by_confidence` at 95/99. `loss_probabilities` at 5/10/20/30% and `gain_probabilities` at 5/10/20%. Per-ticker annualized vols and the exact weight vector used (may exclude tickers with insufficient history).
**Layer 2: rendered note**. Composition table, cumulative-return percentile block, path max-drawdown block, probability grid, one-line Take. See [`references/rendering.md`](./references/rendering.md).
1. **Pull daily aggs** for each ticker over `lookback_days * 1.6 + 14` calendar days. 2. **Align to common dates** across the book. 3. **Fit per-name vol** using `realized` or `ewma` on the aligned window. 4. **Correlation matrix + shrinkage** toward identity for numerical PD safety. 5. **Covariance matrix** from vols × correlation. 6. **Simulate paths** via `simulate_correlated_paths`: Cholesky-factored multivariate normal (or student-t via `sqrt(df/chi2(df))` scaling), one row per path per day. Mean of each daily-return distribution is the historical daily mean. 7. **Portfolio P&L per path** = sum over days of (weight vector · per-name daily return). Path NAV = cumulative product of exp(daily returns). 8. **Distribution stats**: percentile summary on cumulative returns and path max-drawdowns. Path VaR at each confidence is `-quantile(cum_ret, 1-c)`. Expected shortfall averages the tail. 9. **Probability grid**: fraction of paths crossing each loss/gain threshold.
retry, and daily aggs.
Narrative note with a percentile grid. A single portfolio simulation produces a handful of numbers per bucket; a note reads better than a wide table.
ticker. One call per ticker per run.
regime is what the window captured.
GARCH-DCC would improve this at the cost of much more machinery.
not path-dependent utility functions (constant proportional drawdown, etc.).
Merton-style jump-diffusion would add discrete crash events.
These are clean PR extensions. Output schema is forward-compatible.
Trade like a pro. Without the terminal. View the full landing page → Quant and equity research tools that run inside Claude, or behind your own UI.
Scan SEC 8-K disclosures across a single ticker or a watchlist using Massive's pre-parsed disclosure taxonomy. Groups the underlying rows by filing (one 8-K…
Track sell-side analyst positioning on a name via Benzinga Analyst Ratings. Pulls every rating event over the lookback window, classifies each as upgrade /…
Build a clean, point-in-time, ready-to-backtest OHLCV dataset for a US equity universe across an arbitrary date window. Emits parquet plus a manifest plus an…
Bayesian Online Change-Point Detection (BOCPD) on a ticker's daily log returns. Detects points in time where the return-generating distribution changed (regime…
Single-commodity macro read. Answers "is this commodity in a winning or losing macro setup right now" and names the macro driver that dominates it. Pulls one…
Reconcile a position file against splits, dividends, and spinoffs to catch breaks before they hit P&L or T+1 settlement. Use when an operator hands over a CSV…