fix(execution): universal whole-share retention rule for small accounts#307
Merged
Conversation
|
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. |
1 similar comment
|
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. |
This was referenced Jul 8, 2026
…-share compatibility QQQM (TQQQ's unlevered sleeve in tqqq_growth_income) was not in the whole-share retention whitelist. When the strategy's target for QQQM was below 1 share price, the small account compatibility layer zeroed the target, creating an artificial sell signal. After selling, the system couldn't buy back because the target (below 1 share) couldn't be fulfilled, leaving the account in cash. Add QQQM to: - SMALL_ACCOUNT_EXISTING_WHOLE_SHARE_RETENTION_SYMBOLS (unconditional) - SMALL_ACCOUNT_EXISTING_WHOLE_SHARE_RETENTION_MIN_TARGET_SHARE_RATIO_BY_SYMBOL (0.85) - SMALL_ACCOUNT_WHOLE_SHARE_BOOTSTRAP_MIN_TARGET_SHARE_RATIO_BY_SYMBOL (0.85) Co-Authored-By: Claude <noreply@anthropic.com>
abc2d36 to
85b4009
Compare
|
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. |
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.
问题
小账户整数股兼容层的
_should_retain_existing_whole_share使用硬编码白名单决定是否保留已有持仓。每次新策略加了新标的(如 QQQM),都要手动加白名单,否则会出现 sell-then-fail-to-rebuy 的问题。修复
用通用规则替代逐个标的硬编码:
85% 门槛的效果:
变更
_SMALL_ACCOUNT_RETENTION_MIN_TARGET_SHARE_RATIO_DEFAULT = 0.85_should_retain_existing_whole_share接受quantity参数,先走通用规则,再 fallback 到硬编码白名单影响
对所有美国股票策略的所有标的生效,不需要逐个维护白名单。
同步
🤖 Generated with Claude Code