Skip to content

Fix relative exits after non-gap limit parent fills#109

Merged
luisleo526 merged 1 commit into
mainfrom
codex/quant-limit-relative-exit
Jul 16, 2026
Merged

Fix relative exits after non-gap limit parent fills#109
luisleo526 merged 1 commit into
mainfrom
codex/quant-limit-relative-exit

Conversation

@luisleo526

Copy link
Copy Markdown
Collaborator

Summary

  • resume a single pre-armed relative strategy.exit after its non-gap LIMIT parent fills
  • begin child evaluation at the parent actual OHLC-path trigger coordinate
  • preserve existing gap, multi-child, multi-parent, COOF, and magnifier behavior

Root cause

A flat-born relative exit has no concrete stop or target until its parent fills. It was classified as phase 0, scanned before a non-gap LIMIT parent, skipped while flat, and never revisited after its prices materialized.

Scope

The ordering adjustment applies only when:

  • broker state is flat
  • the parent is a prior-bar, flat-born pure LIMIT entry
  • the parent does not fill at the bar open
  • exactly one relative child is attached to that parent
  • parent and child were co-armed in source order
  • the child has no absolute or trailing legs
  • COOF and bar magnifier are disabled

The child joins the parent existing phase rather than a new global phase, preserving P1 / C1 / P2 / C2 source ordering.

Validation

  • new relative-LIMIT contract: 58/58
  • existing stop-parent cursor: 28/28
  • existing MARKET-gap contract: 85/85
  • full CTest suite: 106/106
  • git diff --check: clean

The regression matrix distinguishes accepted base, rejected broad scheduling, and the final fenced behavior. On the private Quant replay, strict matches improve 95 -> 123 of 135 and entry, exit, and PnL P90 become zero. Count parity remains unresolved (246 engine / 135 TV-window), so this PR does not claim a tier promotion.

@luisleo526 luisleo526 merged commit 7cd6141 into main Jul 16, 2026
5 checks passed
@luisleo526 luisleo526 deleted the codex/quant-limit-relative-exit branch July 16, 2026 02:54
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