Retain existing leveraged ETF shares for small accounts#89
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: e41c65c8b4
ℹ️ 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 price > 0.0 and 0.0 < target_value < price and quantities.get(symbol, 0.0) >= 1.0: | ||
| compatibility_targets[symbol] = price |
There was a problem hiding this comment.
Account for the trade threshold when retaining one share
When the default $100 min-trade floor is used and TQQQ is below $100, an account holding exactly two TQQQ shares with a positive sub-share target gets its target raised to one quote here; the later threshold check then sees only a one-share delta (<$100) and skips the sell, leaving two leveraged shares instead of the intended single retained share. The added regression sets current_min_trade to 10, so it misses this production-default path.
Useful? React with 👍 / 👎.
Summary
Tests