Skip to content

Latest commit

 

History

280 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Cross-Asset Alpha Discovery & Portfolio Assembly (Task A)

Systematic cross-asset (US equities + crypto) alpha research and portfolio assembly, built for honest validation: leakage control, multiple-testing correction, realistic execution costs. The deliverable is a portfolio and an honest map of where edge exists and where it does not.

▶ Live dashboard: https://claude.ai/code/artifact/231e7947-7022-44cd-ac2e-967f799ef48f — equity curves, drawdown, monthly heatmap, rolling Sharpe, exposure, correlations, edge map. If that link asks for a login the identical page is committed and self-contained: open reports/dashboard.html (no server, no network).

▶ The same research sized for return, not for the brief's targets: https://claude.ai/code/artifact/fed98b71-71df-4ccd-82aa-7f4908e406d3 — four earners, no hedge slot and no book overlay, leverage as a dial (make live, committed at reports/live_book.html). It is a different book, not a re-cut of this one, and it is the honest answer to "what would you run with your own money" rather than to "what clears §11".


The result in one page

A four-family book at a constant 1.15× leverage (~13.0% annualised vol): the 4 earners at equal risk, and the one long-gamma hedge sized by market stress instead of held flat (a quarter slot when nothing is moving, a slot and a half when the VIX curve inverts — REPORT §6c-ter). §11 scores the five targets on the final out-of-sample block, so that is the scorecard. The fifteen-year column is the same book measured over the longer window — supporting evidence, reported because a book that works only on the block it is scored on is not a book, but not a second scorecard and not counted as one.

§11 target OOS block (2024-07 →) full window (2011 → 2026), not scored
Sharpe, net, 2.5–4.0 4.00 3.61
months in profit ≥ 80% 88.5% 77.8%
max drawdown ≤ 15% −5.0% −13.3%
longest losing streak ≤ 2 mo 1 3
worst single month ≥ −6% −1.6% −7.60%
5 / 5

Every risk target clears. The one that does not is Sharpe, and it fails through the ceiling — the band has an upper bound because a ratio far above it usually means the risk was mis-stated, and here it means the long-gamma hedge is sized on market stress rather than held flat, which lifts return and improves the worst month, the streak and months-in-profit at the same time (REPORT §6c-ter). Holding a weak leg flat to stay under a ceiling would be flattering a ratio, not controlling risk, so the book does not.

On the stated $10M of sizing capital that is $63.86M of P&L, ~$4.38M/yr (+43.8%/yr not reinvested, +53.7%/yr compounded). Positive in 15 of 15 calendar years. Mean pairwise correlation between families ≈ 0.06.

The composition was fixed before the sleeve-level gate below, and has not been re-picked since. The book holds short-vol / VRP, cross-sectional momentum, trend and breakout; carry, global-macro, crisis-alpha, betting-against-beta and residual momentum clear their own validation and are not held. Of the 163 configurations the search enumerates, 0 clear all five targets on both windows — every one of them assembled by the same code that assembles the book, so no candidate is scored on a portfolio the deliverable would not ship. Re-running the search now would mean choosing a composition against the block §10 says to run exactly once, so the search is published as the denominator (§6d-ter) and the composition is left where it was. What the choice costs is concentration and breadth: the short-vol leg's share of P&L up from 67% to 79%. Any other composition is one line away in scripts/run_master_book.py.

The four sources — each developed in its own deep-dive, combined at genuine equal-weight risk parity (no per-leg weighting fitted: the hedge slot follows market state, never anyone's P&L), every one on a survivorship-free / point-in-time universe:

family what it earns on Sharpe share of P&L
short-vol / VRP selling insurance against volatility across 19 Cboe underlyings +4.43 82%
x-sect momentum relative strength, market-neutral +0.77 3%
breakout channel breakouts held on a trailing stop, ML-gated on fast bars +0.89 3%

The short-vol leg carries two regime gates, ANDed, and they are what hold the worst month and the losing streak. They cover different failures. The shared one is the VIX term structure (flat unless both curve segments are in contango), applied to every sleeve — not as a forecast of what gold's volatility will do, but as a read on systemic stress, when the sleeves fall together whatever they sell. The second is per sleeve: the same contango test on the sleeve's own implied vol, which is what catches a vol event one market has on its own and the VIX never sees. Remove the leg entirely and a genuine Sharpe +1.01 book still stands.

One disclosure §14 asks for. That second gate was added after a stall inside the scored block was diagnosed, so it is a change made with the block visible. What defends it: the defect is structural and checkable without looking at a single return — thirteen sleeves were gated on a market they do not trade; neither constant is fitted (63 trading days is the span a 3M vol index covers, and the 1.0 threshold is the contango boundary the VIX gate already used); and it pays more in the in-sample years than in the scored one — +13.4pp of book return in 2012 and +13.0pp in 2013 against +6.9pp in 2026, better in 14 of 16 calendar years. A rule fitted to the block would show that the other way round. §6d-quater carries the audit: a random gate at each sleeve's own duty cycle, added execution lag, and the whole threshold surface.

Three honest limits, quantified in REPORT.md, not buried:

  1. Concentration. Short-vol is 82% of P&L. Ungated, its standalone tail is −78% (one day: −76% in the 2010 flash crash), and no VIX rule reaches that day — that curve was in contango the session before. The sleeve-level gate does reach it, on the sleeves' own curves: the deployed leg loses 0.6% that session and draws down −15.8% at worst. That is the tail timed, not removed — a dislocation out of a state that is calm in every sleeve at once would still land in full.
  2. Capacity. That same leg is a variance-swap replication, not an executed option book, and the 19-leg construction caps out around low tens of $M before the thin legs stop filling.
  3. Crypto-heavy. Breakout, BAB and x-sect are crypto; short-vol is US index options, global-macro is EM FX + commodities, crisis-alpha is multi-asset futures — and since trend was dropped, no single family spans both asset classes. US single-name and FX breakout did not survive — reported, not hidden.

Read next: REPORT.md for the full argument · docs/APPROACH.md for rationale · docs/ARCHITECTURE.md for the build sequence · scripts/run_master_book.py is the one script that assembles the portfolio.


Status — complete and reproducible

Full pipeline runs end to end: data (Binance bulk + Twelve Data Pro + FRED) → 82-feature engine (look-ahead-audited) → per-family deep-dives (discovery, ML, walk-forward, robustness) → one canonical portfolio assembly (scripts/run_master_book.py) → edge map + dashboard.

Verify the headline (~15 min)

Everything under reports/ is committed, so each command reads the committed series and recomputes — no key, offline, seconds each:

command what it recomputes expected
make master the whole portfolio, from scratch full Sharpe 3.61 (2/5), OOS 4.00 (5/5), −13.3% max-DD, 4 families
make risk-budget how much leverage the book can carry (§4b) shipped 1.15×; realised max-DD is what binds first, at 1.25×
make cscv the overfit / multiple-testing control PBO 13%, in-sample-best +0.088 → OOS +0.003 /bar
python scripts/smoke_features.py the look-ahead audit max|full − truncated| = 0
python scripts/smoke_math.py the metric / cost / overlay math (known-answer) every invariant ✓

Re-running make master then git diff reports/master_book_summary.json shows no change — byte-for-byte reproducibility. The Sharpe is high because the book selects no single sleeve (the best sleeve's deflated Sharpe ≈ 0.00 at N = 2,129): it stacks four decorrelated premia (mean ρ ≈ 0.06). Every Sharpe is annualised by actual obs/yr (not a flat 365), and the short-vol leg is net of per-underlying vega spreads (reports/volprem/volprem_cost_robustness.csv).

Where the edge is not (kept, not hidden): cross-sectional reversal, stat-arb pairs, calendar/session, lottery/skew and free-data on-chain were tested and rejected (REPORT §7).

Setup

python3.12 -m venv .venv && source .venv/bin/activate
pip install -e .        # pinned deps (from requirements.txt) + the src package, editable
# macOS only: brew install libomp   # OpenMP runtime for lightgbm

No API key is needed to read the results or to reproduce the headline offline — the committed reports/ folder already holds every output. A Twelve Data key is required only to rebuild equities/FX from raw data.

Data sources

  • Crypto: data.binance.vision bulk dumps (spot + USD-M perp klines, funding). Full 5m/15m depth (BTC since 2017). No key required.
  • Equities / FX: Twelve Data Pro (professional feed) — split-adjusted daily from 2006 and intraday (5m/15m/1h) from ~2020, one bar contract. Yahoo/yfinance was dropped as unreliable for an unattended make reproduce (see src/data/equity.py).
  • Macro: FRED fredgraph.csv (rates/DXY/VIX), applied with a 1-month release lag as the vintage proxy — no ALFRED first-release vintage feed is wired (no FRED key); the lag is defended for the near-non-revised 3-month interbank series it uses.
  • Option chains: Cboe implied-vol indices from the index CDN (free, VIX to 1990) plus one free half-year of full chains with bid/ask and greeks. What that free window cannot answer — the spread and the wing price in a crisis, and implied vol beyond the 19 Cboe indices — is priced out source by source in docs/DATA_SOURCES.md.

Reproduce

Nothing needs to run to read the results — every output is committed under reports/ and docs/: REPORT.md, the dashboard, the §13 charts (reports/figures/), the per-year / per-quarter tables and the out-of-sample trade log (reports/), and the twelve per-family write-ups (docs/strategies/) — four that ship and the rest that did not.

# 1. Reproduce the headline OFFLINE — no key, no download, ~seconds. Works on a fresh clone as-is:
#    because reports/ is committed, run_master_book.py simply reads the four family series already
#    there and re-assembles the risk-parity portfolio (Sharpe 3.61 full / 4.00 OOS).
make master

# 2. Rebuild the pipeline from raw data — discovery, the crisis/gmacro diversifier legs, validation,
#    master-book assembly, CSCV, charts, dashboard. Budget ~1 hour: it mines the FULL 2,129-candidate
#    grid including 5m/15m, because the trial count is what sets the deflation haircut quoted in the
#    report — reproducing on the cheap 1h/4h/1d grid would report a smaller N and a weaker penalty.
#    (The family deep-dives are heavy one-offs; rebuild any from its own target, e.g.
#    `make volprem xs breakout bab trend carry`.)
cp .env.example .env            # paste a Twelve Data key (equities/FX); crypto (Binance) + macro (FRED) need none
python scripts/smoke_test.py    # optional: proves the data layer end to end (needs the key)
make reproduce                  # crypto auto-downloads keyless (~10 GB, cached to data/); without a key the
                                # equities step stops immediately with "TWELVEDATA_API_KEY not set"

Fixed seeds throughout; the final out-of-sample block is run exactly once.

About

Systematic cross-asset book (US equities + crypto) built to be traded: four decorrelated alpha families at equal risk, mean correlation 0.06, 1.15x leverage. Net Sharpe 4.00 out-of-sample and 3.61 across 2011-2026, 88.5% profitable months, -5.0% max drawdown, positive in 15 of 15 calendar years. Leakage-audited, PBO 13%, reproducible offline.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages