Feature-snapshot pipeline that builds validated A-share factor snapshots and evidence artifacts for QuantStrategyLab strategy runtimes.
English | 简体中文
Experimental. Use at your own risk. This project is not financial advice and does not guarantee any trading result. Its outputs are research evidence, not trading instructions.
CnEquitySnapshotPipelines builds factor-snapshot artifacts, manifests, ranking previews, and release summaries for snapshot-backed A-share strategy runtimes. It reads factor input CSVs, or stages them from public data with AkShare, and emits a versioned artifact pack under a stable contract. Downstream strategy and execution repositories consume only validated artifacts.
It does not place broker orders. It does not store broker credentials. It does not make a strategy live on its own.
Requires Python 3.11 or newer.
python -m pip install -e '.[test]'
python -m pytest -qBuild the sample artifact packs from the bundled example inputs:
python scripts/build_dividend_quality_sample.py
python scripts/build_chinext_growth_momentum_quality_sample.pyOr run an installed builder:
cneq-build-dividend-quality-snapshot \
--factor-snapshot examples/dividend_quality/factor_snapshot.sample.csv \
--output-dir data/output/dividend_qualityTo stage factor inputs from public data, install the optional extra:
python -m pip install -e '.[public-data]'
cneq-stage-akshare-dividend-quality --output data/staging/dividend_quality/factor_snapshot.latest.csvThe builders take command-line flags rather than environment variables.
| Flag | Required | Default | Purpose |
|---|---|---|---|
--factor-snapshot |
Yes | none | Factor input CSV; the expected columns are in docs/artifact_contract.md. |
--output-dir |
No | data/output/<profile> |
Directory for the generated artifact pack. |
--min-adv20-cny |
No | 0.0 |
Minimum 20-day average traded value filter. |
--min-market-cap-cny |
No | 0.0 |
Minimum market-cap filter. |
--as-of |
No | UTC today | Snapshot date in YYYY-MM-DD form. |
--output |
No | data/staging/<profile>/factor_snapshot.latest.csv |
Output path for the AkShare staging commands. |
src/ snapshot builders, contracts, and lifecycle helpers
scripts/ sample-build scripts
examples/ sample factor inputs
docs/ artifact contract and design notes
tests/ unit and contract tests
data/ local working output
See CONTRIBUTING.md.
See SECURITY.md. Do not open a public issue for a vulnerability. Keep credentials, private data, and external service tokens out of Git and logs.
MIT. See LICENSE.