Commit Graph

11 Commits

Author SHA1 Message Date
Yuxuan Yan 8d908477e2 Add daily derived data pipeline 2026-06-16 15:55:30 +08:00
Yuxuan Yan 534b91aaa4 Document and abstract portfolio trading costs 2026-06-10 15:41:38 +08:00
Yuxuan Yan 4a477b8f75 Make Backtrader an optional extra 2026-06-10 15:13:11 +08:00
Yuxuan Yan 459336b6cc Document implemented portfolio workflow 2026-06-10 15:04:34 +08:00
Yuxuan Yan 7faeb77c50 chore: manage env with uv (pyproject + lockfile)
Migrate dependency management from requirements.txt to uv. Runtime deps
move to pyproject.toml with pytest in the dev group; uv.lock pins the
resolved set. Docs updated to use `uv sync` / `uv run`.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-06-09 16:20:08 +08:00
Yuxuan Yan 0c524c6987 feat: add alphaview tool to show alpha weights alongside bar data
Joins the bar dataset with one or more alpha parquet files on (symbol, date)
for a given symbol and date range. Standalone tools/alphaview.py wired as
`cli.py alphaview`, plus README docs.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-06-09 15:45:06 +08:00
Yuxuan Yan f4b7ef3ae6 feat: add pqcat helper to inspect parquet files
A standalone tools/pqcat.py (head/tail/columns/info) wired as `cli.py pqcat`
and runnable directly via a PATH symlink, plus README docs.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-06-09 15:33:55 +08:00
Yuxuan Yan de43444ad4 feat: enrich daily bar schema with valuation/status fields + VWAP
Batch download now pulls baostock's preclose, turn, pctChg, tradestatus,
isST, and peTTM/pbMRQ/psTTM/pcfNcfTTM on top of OHLCV+amount, plus a
derived daily VWAP (amount/volume). VWAP is raw-price scale and not
comparable with adjusted OHLC under qfq/hfq — documented in the schema.

Richer fields live only in the batch path (download_daily_batch ->
download_universe); single-symbol download_daily keeps the legacy
8-column schema that test_downloader.py pins. Also flags intraday/L1-L2
microstructure data as a future phase in the README roadmap.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-06-09 14:25:38 +08:00
Yuxuan Yan 1caa63faeb refactor: class-based alpha factory + month-partitioned data pipeline
Replace the old signal/strategy/backtest modules with a decoupled
data → alpha → combo pipeline (parquet between phases, .pq extension).

Alphas:
- BaseAlpha + @register_alpha factory/plugin registry; one file per
  built-in (reversal, reversal_vol, momentum); external alphas via
  --alpha-module. Alphas are z-scored position weights, not predictors.

Data:
- baostock primary / akshare fallback, treated consistently.
- New --universe all (~5000 A-shares via query_all_stock, filtered).
- login-once batch downloader; empty-string OHLCV coerced to NaN.
- Month-partitioned dataset {output_dir}/{universe}/month=YYYY-MM/*.pq
  with chunked durability flushes; --data-path is the dataset dir.

CLI logs at INFO by default (--log-level) so progress is visible.
Docs (README, CLAUDE.md) updated incl. pipeline diagram and roadmap
TODOs for portfolio construction / backtest / paper trading.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-06-09 14:07:07 +08:00
Yuxuan Yan fd86190e9a feat: phase 1 — data downloader, backtrader runner, SMA strategy
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-06-07 09:21:16 +08:00
Yuxuan Yan 338c912029 init: chinese equity quant research framework 2026-06-07 09:14:50 +08:00