Add small-account cash substitution notes#68
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: b7e89fd1d9
ℹ️ 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".
| remaining_non_safe_targets = [ | ||
| symbol | ||
| for symbol in normalized_candidates | ||
| if float(adjusted_targets.get(_normalize_symbol(symbol), 0.0) or 0.0) > 0.0 | ||
| ] |
There was a problem hiding this comment.
Exclude safe-haven symbols from the remaining-risk check
When callers use the default candidate_symbols=None and pass safe_haven_cash_symbols, normalized_candidates becomes every adjusted target, including the safe-haven sleeve. A positive safe-haven target is then counted in remaining_non_safe_targets, so the not remaining_non_safe_targets guard never allows the documented cash substitution path to run (e.g. SOXX below one share with BOXX as the only remaining $1,224 sleeve leaves BOXX untouched). The tests avoid this by explicitly passing only the risk symbol as candidate_symbols, but the public default makes the new helper skip the fallback in the natural all-targets call path.
Useful? React with 👍 / 👎.
Summary
Tests