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…
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 edge-case log, with corporate actions reconciled, survivorship treatment documented, holidays and half-days preserved
$ npx -y skills add rgourley/quant-garage --skill backtest-data-prep --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
/backtest-data-prepContext preview
The summary Claude sees to decide when to auto-load this skill.
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 edge-case log, with corporate actions reconciled, survivorship treatment documented, holidays and half-days preserved
name: backtest-data-prep description: 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 edge-case log, with corporate actions reconciled, survivorship treatment documented, holidays and half-days preserved correctly, and any IPO partial coverage or trading halts flagged. The dataset is the artifact a downstream Python/R/Julia backtester consumes; the rendered summary is the operator-readable companion. First skill in the suite that ships dataset output mode.
You hand over a universe definition, a date window, and an output directory. The skill emits a clean OHLCV+volume parquet plus a manifest plus an edge-case log. The downstream consumer is a backtester (your Python loop, QuantConnect, vectorbt, zipline-reloaded, etc.), not a human reader.
The skill's value is correctness. Quants spend 80% of their time on data prep, and the most common backtest bugs come from five sources:
1. **Survivorship bias.** Backtesting against today's top-500 silently excludes 2022-2024 failures (FRC, SVB, BBBY, SI). The remaining cohort outperforms the true historical population because the losers are gone. 2. **Look-ahead bias on fundamentals.** Using the latest revised consensus instead of point-in-time. The signal contains forward-looking information that wasn't available at the rebalance. 3. **Corporate action mis-adjustment.** Pre-split prices not adjusted, or adjusted using the wrong factor. 4. **Holiday and half-day handling.** Missing days treated as errors or filled wrong. 5. **Inconsistent calendar alignment.** Calendar dates vs trading dates, US vs global market hours.
The skill addresses all five and documents the treatment in the manifest.
for my mean-reversion backtest"
panel can carry
parquet", "I need point-in-time prices for a universe"
`custom:path/to/tickers.csv`)
flat-files entitlement probed and REST fallback used when not granted)
A 4-year top-100 run:
A 5-year top-500 run is roughly 5x the REST time and 2-3x the flat-files time (the bottleneck shifts from day-bucket fetch to per-ticker corp action calls).
Three files in the output directory, plus a rendered summary printed to stdout.
**Files:**
in [`references/output-formats.md`](./references/output-formats.md).
survivorship treatment, corp action methodology, source endpoints, every parameter that affects reproducibility, run timestamp.
detected: trading halt, IPO partial coverage, delisting during window, ticker change, data gap.
**Layer 1: canonical JSON** matching [`output-schema.json`](./output-schema.json). Emitted to stdout alongside the rendered summary so downstream tools that wrap the CLI can parse the run metadata without re-reading the manifest.
**Layer 2: rendered dataset summary** in the style of a clean-data report (think QuantConnect's data quality report or Bloomberg's BDH audit). See [`references/rendering.md`](./references/rendering.md). Files written, universe construction, corporate actions applied, coverage, edge cases, schema, sources, take. The take answers the question a quant asks at the top of every backtest: "is this dataset actually clean enough to trust?"
1. **Construct the universe** per [`references/survivorship-handling.md`](./references/survivorship-handling.md). For the default top-N seeds, pull `/v3/reference/tickers` (active and delisted both), enrich with market cap from `/v3/reference/tickers/{ticker}`, rank, and keep the top N. The universe label records whether the seed is forward-looking biased (it usually is for current top-N). 2. **Filter to common stock.** Reference-endpoint `type` field; drop ETFs, ETNs, ADRCs, units, warrants, rights. Documented in the manifest because the consumer may want to override. 3. **Pull daily aggregates** for the window. Flat-files preferred (`s3://flatfiles/us_stocks_sip/day_aggs_v1/{yyyy}/{mm}/{yyyy-mm-dd}.csv.gz`, parallelized 16 workers). REST fallback when entitlement is missing: `GET /v2/aggs/grouped/locale/us/market/stocks/{date}?adjusted=true`, one call per trading day. Pattern matches `factor-research`. See [`../massive-flat-files/SKILL.md`](../massive-flat-files/SKILL.md) entitlement section. 4. **Pull splits and dividends** per [`references/corporate-action-adjustment.md`](./references/corporate-action-adjustment.md). `GET /v3/reference/splits?ticker={T}` and `GET /v3/reference/dividends?ticker={T}`. Massive's grouped aggs are split-adjusted by default (`adjusted=true`), so the skill does NOT re-apply the split ratio to OHLC; it does emit a cumulative adjustment factor as a separate column so the consumer can un-adjust if their backtester wants raw prints. 5. **Pull ticker reference** for sector enrichment. One call per ticker, parallelized. Adds `sic_code` and `sector` columns to the parquet. 6. **Detect edge cases.** IPO partial coverage (w
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 /…
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…
Scan for material 8-K corporate actions over a lookback window. For a ticker or watchlist, pulls SEC EDGAR 8-K filings, filters to material items (offerings,…