Repository navigation
Add cash-paid cost-aware rebalancing from actual marked holdings - #90
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The existing portfolio objective considers expected returns and risk but pays trading costs only afterwards. Add opt-in cash-paid rebalancing that plans from actual marked holdings with fees inside both its mean-variance objective and funding constraint. Weak forecasts can leave the account unchanged; permissions and monetary caps restrict the plan before trading.
Each row marks actual holdings, estimates covariance using strictly prior return rows, optimizes, executes through the existing self-financing constrained ledger, and carries actual fills/cash forward. A monetary position-value cap permits existing drift to remain without increasing its value. Failed or infeasible solves hold exact positions and record the reason. The cached convex problem is DPP; solver status and feasible baseline selection remain inspectable.
mlquant rebalancereuses saved return forecasts and the panel, optionally derives strictly lagged monetary caps, and writes separate reports/full ledgers. Planning and execution use one fee rate. Legacy fixed-target and Markowitz defaults remain unchanged. This is a long-only historical mark-price policy with same-row sale proceeds, not a live or calibrated exchange execution system.Type of change
Reproducibility
Validation
Raw audit and all controls. Reduced fees do not guarantee higher realized returns; controls retain both directions. Synthetic forecasts contain no intended alpha, and no public-data snapshot is revalidated.