Skip to content

Apply small-account whole-share compatibility#7

Merged
Pigbibi merged 1 commit into
mainfrom
small-account-whole-share-compat
May 23, 2026
Merged

Apply small-account whole-share compatibility#7
Pigbibi merged 1 commit into
mainfrom
small-account-whole-share-compat

Conversation

@Pigbibi

@Pigbibi Pigbibi commented May 23, 2026

Copy link
Copy Markdown
Contributor

Applies the small-account whole-share compatibility layer in Firstrade value-target planning after safe-haven cash substitution. Unbuyable positive target values are projected to cash before sell and buy planning.

Validation:

  • python -m pytest tests/test_execution_service.py -q -k 'projects_unbuyable_value_target_to_zero or leaves_small_safe_haven_target_as_cash or sells_before_buys'
  • python -m py_compile application/execution_service.py

@Pigbibi Pigbibi force-pushed the small-account-whole-share-compat branch from 4f4e018 to 9692af9 Compare May 23, 2026 02:38

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 4f4e018c91

ℹ️ 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".

Comment on lines +200 to +203
plan = _apply_small_account_whole_share_compatibility(
plan,
market_data_port=market_data_port,
)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Propagate whole-share-adjusted targets to caller-visible plan

Apply the whole-share compatibility layer before execution result reporting, not only inside execute_value_target_plan: these lines mutate plan locally for order generation, but run_strategy_cycle still reports allocation from the original pre-execution plan (application/rebalance_service.py uses its outer plan at result assembly). When a positive target is projected to zero here, submitted orders follow the adjusted targets while API/notification output still shows the old nonzero target, creating inconsistent and misleading cycle results.

Useful? React with 👍 / 👎.

@Pigbibi Pigbibi merged commit 96fcd31 into main May 23, 2026
1 check passed
@Pigbibi Pigbibi deleted the small-account-whole-share-compat branch May 23, 2026 02:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant