Skip to content

Decline unaffordable explicit-qty flat market entries at fill#92

Merged
luisleo526 merged 1 commit into
mainfrom
fix/explicit-qty-fill-admission
Jul 11, 2026
Merged

Decline unaffordable explicit-qty flat market entries at fill#92
luisleo526 merged 1 commit into
mainfrom
fix/explicit-qty-fill-admission

Conversation

@luisleo526

Copy link
Copy Markdown
Collaborator

What

TV re-checks an explicit-qty MARKET entry at its fill: an entry placed true-flat whose quantity notional at the slipped next-open fill exceeds placement-time equity is declined outright, with zero slack — commission plays no part (fee-only overage is admitted and entry-bar-trimmed as before). The engine previously admitted every explicit entry that passed the signal-time gate, so all-in idioms (qty = min(risk, equity/close) floored to step) opened phantom positions on every adverse one-tick gap.

Implementation: disjoint fill-time branch scoped to explicit-qty (non-NaN) MARKET entries created flat with no same-bar paired close; margin-scaled arithmetic; the slipped-signal-close notional floors the threshold so process_orders_on_close and no-gap fills are structural no-ops. Signal-time gate unchanged. The frozen-default path (own rules, one-lot slack — pinned separately) is intentionally not unified.

Evidence

  • New clean-room probe (committed): floor-quantized all-in, zero commission, 4,740 from-flat attempts — TV admits 0 above-slack and 0 in-band overshoots vs 566 in-band rejects; decline iff fill notional > equity, 99.94% concordance. Kills commission-scoping.
  • Exemplar strategy: perfect 306/306 admit/decline separation; converges moderate → excellent (pnl p90 22.65% → 0.12%, entry set 100%).
  • A previously-documented TV-anomaly probe with a different (round-half-up) sizing idiom remains quarantined; its expected small tape movement was pre-declared and it stays anomaly-classified.

Gates (author + independent fresh-context R7, both green)

  • REDs by stash-cycle: new suite 24/5 and repurposed fixtures 152/7 pre-fix → 29/29 + 159/159 post.
  • Full ctest 90/90; corpus 252/252 — 240 excellent / 11 strong / 1 anomaly, stash-isolation proof shows exactly ONE tape moved (the pre-declared anomaly probe).
  • Private validation sweeps: targeted 1 UP (the exemplar, moderate→excellent) / 0 DOWN with every sentinel holding tier; full 412 inventory stable, 0 further movement.
  • Four legacy synthetic fixtures asserting fill-then-trim/hold for this exact class repurposed to the TV-pinned decline (Lead-adjudicated; trim semantics remain pinned by frozen-path/default-sized suites).

🤖 Generated with Claude Code

TradingView re-checks an explicit-qty MARKET entry at its fill: an
entry placed true-flat whose quantity notional at the slipped next-open
fill exceeds the placement-time equity is declined outright, with ZERO
slack — commission plays no part in the predicate (fee-only overage is
admitted and entry-bar-trimmed as before). The engine previously
admitted every explicit entry that passed the signal-time gate, so
all-in idioms (qty = equity/close, floored to step) opened phantom
positions on every adverse one-tick gap.

The signal-time gate is unchanged and remains the first line of
defense; the new fill-time re-check is a disjoint branch scoped to
explicit-qty (non-NaN) MARKET entries created flat with no same-bar
paired close, margin-scaled, with the slipped-signal-close notional as
a floor so process_orders_on_close and no-gap fills are structural
no-ops. The frozen-default path (its own admission rules, one-lot
slack) is intentionally not unified — its slack is pinned separately.

Evidence: new clean-room probe (floor-quantized all-in, zero
commission, 4,740 from-flat attempts across 13 months): TV admits
0 above-slack and 0 in-band overshoots vs 566 in-band rejects — decline
iff fill notional exceeds equity, 99.94% concordance; exemplar strategy
shows perfect 306/306 admit/decline separation and converges from
moderate to excellent (pnl p90 22.65% -> 0.12%). Four legacy synthetic
fixtures that asserted fill-then-trim/hold for this exact class are
repurposed to the TV-pinned decline; the trim semantics they exercised
remain pinned by the frozen-path and default-sized suites.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@luisleo526 luisleo526 merged commit 8b5932f into main Jul 11, 2026
5 checks passed
@luisleo526 luisleo526 deleted the fix/explicit-qty-fill-admission branch July 11, 2026 00:32
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