This repo is a reproducible, end-to-end “alpha research loop” for market-neutral, medium-frequency equity signals:
- download/cached data (default: Yahoo via
yfinance) - compute factor library (signals)
- run purged walk-forward validation
- build daily market-neutral long/short portfolios
- apply turnover-aware transaction costs
- combine signals using an online L1-budget allocator (differentiator)
- generate a report (CSV + Markdown + plots)
⚠️ Research/education only. Not investment advice.
If we only “try random alphas” on platforms (WorldQuant BRAIN etc.), it’s easy to get stuck. This repo forces a real research workflow: hypothesis → signal → strict evaluation → robustness → library → combination.
python -m venv .venv && source .venv/bin/activate
pip install -r requirements.txt
pip install -e .
# run end-to-end pipeline (downloads/caches data, then backtests)
python -m alphafactory.run --config configs/base.yamlOutputs go to: results/<timestamp>/
factor_ic_summary.csv— factor IC / ICIR by splitportfolio_daily_returns.csv— daily L/S returns (gross + net of costs)report.md— summary + key plots
Default data is downloaded with yfinance for convenience. This is not survivorship-bias free and is not “publication-quality”.
For production-grade research we can use CRSP/Compustat (WRDS), Norgate, etc.
This repo is built so you can swap in a different data source later:
- see
src/alphafactory/data/
alpha-factory-pro/
configs/
base.yaml
src/alphafactory/
data/
features/
validation/
portfolio/
allocator/
metrics/
reports/
run.py
tests/
paper/one_pager.md
results/ # gitignored
- Qlib (data + ML quant pipeline): https://github.com/microsoft/qlib
- Alphalens (factor analysis): https://github.com/quantopian/alphalens
- vectorbt (fast vectorized research/backtests): https://vectorbt.dev/
- Ken French data library (FF factors for attribution): https://mba.tuck.dartmouth.edu/pages/faculty/ken.french/data_library.html