Ship v0.3 real-data quantitative engineering showcase#25
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: b09945a62e
ℹ️ 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".
| daily = primary.copy() | ||
| daily["signal_available_date"] = ( | ||
| pd.Series(factors.index, index=factors.index) | ||
| .shift(1) | ||
| .loc[oos_factors.index] |
There was a problem hiding this comment.
Shift decision columns before publishing ledger
For each OOS row, daily is copied from primary, so decision_weight and realized_vol_at_decision are still calculated with the execution day's return; only executed_weight is lagged. The new signal_available_date then labels those same-day decision columns as if they were available the previous session, so daily.csv/the verifier present a look-ahead decision ledger even though the return calculation uses the lagged weight. Shift or relabel the decision columns before publishing them.
Useful? React with 👍 / 👎.
| qty = abs(delta_qty) | ||
| side = cast(Literal["BUY", "SELL"], "BUY" if delta_qty > 0 else "SELL") |
There was a problem hiding this comment.
Allow target-weight orders that reduce capped exposure
When a target_weight order reduces an already-over-cap position but leaves it above the configured cap (for example 100% long -> 40% target with max_exposure=0.3), this emits a SELL delta, but the later exposure/single-name/gross cap checks still compare only the post-trade exposure to the cap and drop the order. That blocks de-risking unless the target is below every cap; the cap gates need to allow orders that reduce absolute/gross exposure from the current state.
Useful? React with 👍 / 👎.
| from microalpha.artifact_verify import verify_artifacts | ||
|
|
||
| verification = verify_artifacts("docs/assets/market_case") |
There was a problem hiding this comment.
Outcome
python -m microalphasurfacePORTFOLIO_IMPACT_BRIEF.mdLocal evidence
microalpha 0.3.0ee8fd20013c3469809c0b4054d61fa85db5eafe62de0551548c5595427bca1d16e36c2397696d7e9eecbd058cbfc1ba522c8ffba7e5798224de86b20457b6575