Skip to content

Gate role-changing fixed reversals by free margin#86

Merged
luisleo526 merged 1 commit into
mainfrom
codex/reversal-margin-admission
Jul 10, 2026
Merged

Gate role-changing fixed reversals by free margin#86
luisleo526 merged 1 commit into
mainfrom
codex/reversal-margin-admission

Conversation

@luisleo526

Copy link
Copy Markdown
Collaborator

What changed

  • Recheck omitted-quantity fixed market entries when an earlier sibling fill changes them from a same-direction order into a reversal.
  • Compare the augmented close-plus-open transaction against free margin at the actual fill.
  • Add boundary and scope tests for equality, explicit quantities, non-100% margins, percent-of-equity sizing, ordinary adds, and slippage.

Root cause

Two market entries can be queued for the same next tick. The second may be same-direction when created, then become a reversal after the first fills. The engine admitted that stale-role order without rechecking the larger reversal transaction, producing an extra flip.

Impact

The validated GB2 strategy moves from moderate to strong: engine trades 3153 → 2685, with all 2617 TV trades matched and count delta reduced 536 → 68. The full campaign sweep had one upward tier move and no downward moves.

Validation

  • Focused margin-admission test: 72/72 assertions
  • Full engine suite: 83/83
  • Corpus validation: 252/252; tiers unchanged at 239 excellent / 12 strong / 1 anomaly
  • Full 412-strategy sweep: 274 excellent / 79 strong / 32 moderate / 15 weak; 1 up / 0 down
  • Independent semantic review: GO

Production diff SHA-256: c204dddb8a9126c8bed503eb2a425d1e7051a1056a9bc37f69bdbb5810330302

@luisleo526 luisleo526 marked this pull request as ready for review July 10, 2026 08:29
@luisleo526 luisleo526 merged commit 5898eb9 into main Jul 10, 2026
5 checks passed
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