Skip to content

Preserve final-bar sell signal until next market open #6

Closed

Description

@andywkff

Problem

When an exit rule fires on the final input bar, the core returns .exit but also synthesizes a completed trade at that bar's close. This contradicts next-market-open execution semantics.

Acceptance criteria

  • Final-bar exit remains pending and emits no completed trade for that position.
  • Adding the next bar completes the trade at the next bar's open.
  • Existing open-position finalization behavior without a pending exit remains unchanged.
  • Targeted and full Swift tests pass.

Activity

  1. andywkff commented on Aug 21, 2026

    @andywkff
    ContributorAuthor

    Fixed on codex/preserve-pending-exit.

    • A final-bar exit now remains .exit with no completed trade for that position.
    • Supplying the next bar completes the trade at that bar's open with exit-rule.
    • Focused regression test passed.
    • Full stable Swift suite passed: 128 tests, 0 failures.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions