Quant Buffet API
Universes & whitelist
Named ETF books and the 81 symbols the sandbox will accept in ASSETS.
`backtest.universes` defines liquid ETF proxies for equities, sectors, countries, bonds, commodities, real estate, volatility, and crypto. Only symbols in `WHITELIST` can appear in ASSETS — currently 81 tickers.
Named books
| Constant | Contents | Typical use |
|---|---|---|
US_EQUITY | SPY, QQQ, IWM | Core US beta |
US_SECTORS | XLB, XLE, XLF, XLI, XLK, XLP, XLU, XLV, XLY | Nine-sector rotation |
US_SECTORS_FULL | US_SECTORS + XLC, XLRE | All 11 sectors (short history) |
GLOBAL_EQUITY | SPY, EFA, EEM, VGK, EWJ, FXI | Cross-region momentum |
COUNTRY_DM | 15 developed-market ETFs (EWA … EWY) | Country momentum |
COUNTRY_EM | 13 emerging-market ETFs (EWZ … ASHR) | EM rotation |
BONDS | SHY, IEF, TLT, LQD, HYG, TIP, BND | Duration and credit ladder |
CREDIT | LQD, HYG, AGG, BIL | Credit spread work |
COMMODITIES | GLD, SLV, DBC, GSG, USO, UNG, DBA | Inflation and crisis hedges |
REAL_ESTATE | VNQ, IYR, RWX | REIT exposure |
MULTI_ASSET | SPY, EFA, EEM, VNQ, DBC, GLD, TLT, IEF, HYG | Balanced allocation research |
RISK_ON_OFF | SPY, QQQ, TLT, IEF, GLD, BIL | Offence / defence switching |
VOL_PROXY | SPY, BIL, VIXY, SVXY | Volatility strategies |
CRYPTO_PROXY | BTC-USD, ETH-USD | Crypto momentum |
FX_SAFE | SPY, EFA, EWJ, GLD, TLT | Dollar-sensitive mix |
The complete whitelist
| Group | Symbols |
|---|---|
| US broad | SPY, VOO, VTI, QQQ, IWM, DIA, MDY, RSP, OEF |
| Global broad | ACWI, ACWX, URTH, VEA, VWO, EFA, EEM, VGK |
| US sectors | XLB, XLC, XLE, XLF, XLI, XLK, XLP, XLRE, XLU, XLV, XLY |
| Developed countries | EWA, EWC, EWD, EWG, EWH, EWI, EWJ, EWK, EWL, EWN, EWP, EWQ, EWS, EWU |
| Emerging countries | EWY, EWZ, EWT, FXI, ASHR, EIDO, THD, EPHE, ECH, EPOL, EZA, ARGT, TUR |
| Rates & credit | BIL, SHV, SHY, IEI, IEF, TLT, TIP, MBB, AGG, BND, LQD, HYG |
| Commodities | GLD, SLV, DBC, GSG, USO, UNG, DBA |
| Real estate | VNQ, IYR, RWX |
| Volatility | VIXY, SVXY |
| Crypto | BTC-USD, ETH-USD |
Using a book in ASSETS
python
from backtest.universes import US_SECTORS, BOOKS, WHITELIST
# Books are plain lists — slice, extend, or combine them
ASSETS = list(US_SECTORS) + ["TLT", "GLD", "BIL"] # 12 symbols
# BOOKS maps short keys to lists, used by the catalog generator
ASSETS = list(BOOKS["risk_on_off"]) # 6 symbols
# Verify before running
bad = [s for s in ASSETS if s not in WHITELIST]
assert not bad, f"Not whitelisted: {bad}"
assert len(ASSETS) <= 15History caveats worth remembering
| Symbol | Constraint |
|---|---|
XLC | Launched June 2018 — truncates any long sector test |
XLRE | Launched October 2015 |
SVXY, VIXY | Post-2011, and SVXY changed its leverage mandate in 2018 |
BTC-USD | Data begins around September 2014 |
ETH-USD | Data begins around November 2017 |
USO, UNG | Futures-based: the fund's own mandate has changed over time |