Let LongBridge sell BOXX when buying power is short#65
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 59f8630aaa
ℹ️ 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".
| if sweep_quantity <= 0: | ||
| sweep_quantity = 1 |
There was a problem hiding this comment.
Do not force BOXX sale when funding need is zero
When cash_sweep_sale_quantity_to_fund_buy(...) returns 0 (for example, because current investable cash already covers the next buy), this branch overwrites it to 1 and still submits a BOXX sell. In execute_rebalance_cycle, that means any cycle with a buy candidate and sellable BOXX can generate an unnecessary market sell even though no additional funding is needed, causing avoidable churn and allocation drift.
Useful? React with 👍 / 👎.
Adjust the LongBridge execution flow so the cash-sweep symbol can be sold even when the underweight candidate is smaller than one share and buying power is short.
This keeps the platform from getting stuck holding BOXX when the strategy wants to move into SOXL/SOXX but only a partial position can be funded on the current run.
Tests: