Skip to content

[pull] master from polakowo:master#53

Merged
pull[bot] merged 3 commits into
PyQuantSharp:masterfrom
polakowo:master
Mar 27, 2026
Merged

[pull] master from polakowo:master#53
pull[bot] merged 3 commits into
PyQuantSharp:masterfrom
polakowo:master

Conversation

@pull

@pull pull Bot commented Mar 27, 2026

Copy link
Copy Markdown

See Commits and Changes for more details.


Created by pull[bot] (v2.0.0-alpha.4)

Can you help keep this open source service alive? 💖 Please sponsor : )

coryvirok and others added 3 commits March 26, 2026 12:47
…with short positions

gross_exposure() was computing net signed exposure instead of gross
exposure for grouped portfolios. For short-only positions, it returned
negative values; for mixed long/short, it could return wildly inflated
values (e.g. 6000%+ when actual gross exposure was ~50%).

Root cause: when group_by is active, asset_value is the net sum of
per-column values (longs - shorts). For gross exposure, we need the
sum of absolute per-column values. The fix computes
abs(per-column asset values) before group aggregation.

The existing net_exposure() method is unaffected — it correctly
computes long_exposure - short_exposure from direction-filtered
gross_exposure calls.

Fixes #836.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
fix: gross_exposure() uses abs(asset_value) for grouped portfolios
@pull pull Bot locked and limited conversation to collaborators Mar 27, 2026
@pull pull Bot added the ⤵️ pull label Mar 27, 2026
@pull pull Bot merged commit 993ceca into PyQuantSharp:master Mar 27, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants