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>
This commit is contained in:
Yuxuan Yan
2026-06-09 14:25:38 +08:00
parent 419114b87b
commit de43444ad4
4 changed files with 57 additions and 17 deletions
+20 -9
View File
@@ -4,15 +4,26 @@ from typing import Final
# Required columns for data parquet files (daily bars, alternative data, etc.)
DATA_COLUMNS: Final[list[str]] = [
"symbol_id", # str: internal code like 'sh600000'
"symbol_name", # str: stock name like '浦发银行'
"date", # date
"open", # float64
"high", # float64
"low", # float64
"close", # float64
"volume", # float64 (shares)
"amount", # float64 (turnover in yuan)
"symbol_id", # str: internal code like 'sh600000'
"symbol_name", # str: stock name like '浦发银行'
"date", # date
"open", # float64
"high", # float64
"low", # float64
"close", # float64
"preclose", # float64: previous trading day's close
"volume", # float64 (shares)
"amount", # float64 (turnover in yuan, raw/unadjusted)
"vwap", # float64: daily VWAP = amount / volume. NB raw price scale —
# NOT comparable with adjusted OHLC under qfq/hfq.
"turn", # float64: turnover rate (%)
"pctChg", # float64: daily % change
"tradestatus", # int: 1 = traded, 0 = suspended
"isST", # int: 1 = ST/special-treatment, 0 = normal
"peTTM", # float64: trailing-12m P/E
"pbMRQ", # float64: P/B (most recent quarter)
"psTTM", # float64: trailing-12m P/S
"pcfNcfTTM", # float64: P/CF (net cash flow, TTM)
]
# Required columns for alpha parquet files.