[codex] add chinext growth momentum quality snapshot#14
Conversation
Co-Authored-By: Codex <noreply@openai.com>
|
Bugbot is not enabled for your account, so this pull request was not reviewed. Enable Bugbot in the Cursor dashboard to get automatic reviews on future PRs. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 2b63cbe2b2
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| min_adv20_cny: float = 0.0, | ||
| min_market_cap_cny: float = 0.0, |
There was a problem hiding this comment.
Preserve the strategy's production floors by default
When callers use this new builder or CLI without threshold flags, these 0.0 defaults are passed into both score_candidates and compute_signals, overriding the pinned strategy's nonzero liquidity and market-cap defaults. For this profile that means zero-market-cap rows can remain eligible and even receive weights; the added sample's 159915 ETF has market_cap_cny=0 and is not the strategy safe-haven, so the default sample build can allocate to it instead of filtering it out. Use the strategy defaults here or only pass these values when explicitly provided.
Useful? React with 👍 / 👎.
| dependencies = [ | ||
| "pandas>=2.0", | ||
| "cn-equity-strategies @ git+https://github.com/QuantStrategyLab/CnEquityStrategies.git@8dfadcf8a4dc6cc516f27a4013248474603d8ce2", | ||
| "cn-equity-strategies @ git+https://github.com/QuantStrategyLab/CnEquityStrategies.git@1bced052d515373e88620dae48499a4ad44c10f7", |
There was a problem hiding this comment.
Update the lockfile with the dependency bump
This dependency is bumped to the commit that provides the new ChiNext strategy module, but the checked-in uv.lock still pins cn-equity-strategies to 8dfadcf8a4dc6cc516f27a4013248474603d8ce2. Any locked uv install will not resolve the dependency state represented by this change and can end up without the module imported by chinext_growth_momentum_quality.py; please regenerate and commit the lockfile alongside this pin change.
Useful? React with 👍 / 👎.
| snapshot = _ensure_snapshot_as_of(_read_csv(factor_snapshot_path), as_of=as_of) | ||
| ranking = score_candidates( |
There was a problem hiding this comment.
Keep non-ChiNext rows out of the new sleeve
This builder forwards the entire CSV into score_candidates without enforcing the contract's ChiNext universe, so a broad A-share factor snapshot can let non-300-prefixed stocks or ETFs that satisfy the factor screens enter the ranking and target weights. This is separate from the market-cap floor: a large non-ChiNext row would still pass the new profile's scoring path unless the pipeline validates or filters symbol to ChiNext stock codes before scoring.
Useful? React with 👍 / 👎.
| 300001,software,28.0,80000000.0,25000000000.0,0.32,0.28,0.10,0.18,0.75,0.70,0.24,0.16,0.12,0.28,True,0,False,1200 | ||
| 300002,biotech,44.0,60000000.0,18000000000.0,0.24,0.21,0.06,0.15,0.68,0.66,0.18,0.12,0.08,0.24,True,0,False,900 | ||
| 300003,new_energy,16.0,55000000.0,14000000000.0,0.04,-0.02,-0.01,0.08,0.50,0.48,0.05,0.03,0.01,0.20,True,0,False,800 | ||
| 159915,etf,3.5,1000000000.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.12,True,0,False,3000 |
There was a problem hiding this comment.
Include the actual safe-haven row in the sample
For the default sample build, the ChiNext strategy assigns the uninvested/defensive weight to its default safe-haven symbol 511880, but this sample includes 159915 instead. After the production floors/non-ChiNext filtering are fixed, the generated release summary can still reference 511880 in target_weights/managed symbols without any corresponding snapshot row, which makes the sample artifact pack inconsistent for downstream jobs that expect metadata for every managed symbol.
Useful? React with 👍 / 👎.
Summary
Test Plan
PYTHONPATH=src:/Users/lisiyi/Projects/CnEquityStrategies/src python3 -m pytest -qPYTHONPATH=src:/Users/lisiyi/Projects/CnEquityStrategies/src python3 scripts/build_chinext_growth_momentum_quality_sample.py