feat: add portfolio phase — discretize alpha weights into tradable positions
Adds a fourth pipeline phase modeling A-share microstructure: lot sizes, the 2023-08-10 Main Board increment change, STAR 200-share minimum/odd-lot rules, limit-up/down, suspensions, volume caps, costs, and slippage. Two layers: research (continuous weights → return/Sharpe/turnover/Fitness, no IC per repo convention) and execution (state-dependent lot rounding + two-stage greedy exposure repair + next-open reference simulator). Wires `portfolio build/simulate/eval` into the CLI and adds the POSITION/FILL/PNL schema contracts. Covered by tests/test_portfolio.py. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
@@ -2,9 +2,10 @@
|
||||
"""Chinese Equity Quant Pipeline — decoupled phase CLI.
|
||||
|
||||
Phases:
|
||||
data — Download daily bars to parquet
|
||||
alpha — Compute alpha weights from data
|
||||
combo — Combine alphas into a single weight
|
||||
data — Download daily bars to parquet
|
||||
alpha — Compute alpha weights from data
|
||||
combo — Combine alphas into a single weight
|
||||
portfolio — Build tradable positions and simulate execution
|
||||
"""
|
||||
|
||||
import logging
|
||||
@@ -14,6 +15,7 @@ import click
|
||||
from pipeline.data.cli import data
|
||||
from pipeline.alpha.cli import alpha
|
||||
from pipeline.combo.cli import combo
|
||||
from pipeline.portfolio.cli import portfolio
|
||||
from tools.pqcat import pqcat
|
||||
from tools.alphaview import alphaview
|
||||
|
||||
@@ -39,6 +41,7 @@ def cli(log_level):
|
||||
cli.add_command(data)
|
||||
cli.add_command(alpha)
|
||||
cli.add_command(combo)
|
||||
cli.add_command(portfolio)
|
||||
cli.add_command(pqcat)
|
||||
cli.add_command(alphaview)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user