Repository navigation
Commit 9fa1ac5
Fix fill recalculation, declared quantity steps, and intraday request grids (pineforge-4pass#727) [skip ci]
Fixes pineforge-4pass#723
Fixes pineforge-4pass#708
Fixes pineforge-4pass#722
Fixes pineforge-4pass#720
Part of pineforge-4pass#716: the engine now floors order quantities to a declared quantity step (qty_step, or mincontract when no qty_step is declared), which covers items 1 and 2 for runs that declare it; runs that declare neither key are unchanged, and the issue stays open until the callers supply the step.
This change corrects entry handling during fill recalculation, uses an explicitly declared minimum contract as the quantity step, and aligns requested bars with the session grid.
### Entry replacement and the pyramiding cap
With fill recalculation enabled and a flat book, a later same-id entry now replaces an earlier held priced entry. Previously the earlier held entry could be submitted afterwards and replace the later market entry. TradingView captures of the reproduction keep the later market entry with orders processed both at the next open and on close.
The engine call logs for two seeded random scenarios show the same priced-entry then market-entry shape on the two divergence bars, with identical calls before and after the fix. The logged position is the script's view; which order wins is shown by the trade comparison. There is no TradingView tape of those random scenarios. Their eight pinned runs move; the other runs retain their recorded values.
A settled opening also occupies its pyramiding slot while its applied notification is still queued. This prevents an explicit close followed by a reversing same-id entry from admitting a second lot past a cap of one. A 150-resting-limit test covers the large-book case. Its helper matches sell limits at the adapter's half-tick matching threshold; the order's own price is unchanged. A real-bars TradingView script of the same order shape refuses the repeated short lot. That capture is not a tape of the seeded transcript and is not a class-wide claim. The reported behavior is present in the released 1.9.1 engine.
### Declared quantity step
When a symbol declares a minimum contract and no separate quantity step, the declared minimum contract supplies the step. The default path with neither declaration remains unchanged. The public test names the floor's one-millionth-of-a-step epsilon limit. Stop-limit chronology is outside this quantity-step change.
This reaches library callers that set mincontract alone and preserves explicit qty_step precedence. Nothing is inferred from the symbol name.
The default-metadata path and the other order-quantity cases in pineforge-4pass#716 remain open.
### Requested-bar session grid
TradingView-checked: BINANCE:BTCUSDT 24x7 at 75m over 2025-04-01..04 (a bar opens at 00:00 UTC each day; the last bar of a day is 23:45-00:00). Session symbols, late-open anchoring, other time zones / DST and widths of a day or more are engine expectations, not TradingView-measured.
The reviewed source candidate matched twelve BTC TradingView rows at 205 joined and equal trades each, and both explicit-session equity rows at 40 joined and equal trades each. These are member evidence for those cases; the combined candidate also passed full verification.
The capped final time_close and DST characterization are engine expectations without a TradingView tape. An empty after-close bucket completes immediately and has no feed-level completion row. The default-session case remains open in the caller-metadata work. The open-label-only mutation survives by construction; the prefix-key mutation produces two completions and fails the existing one-completion assertion. The two default-session rows are deferred intact, with no skip or xfail introduced.
### Native-live report compatibility
Native-live modules built with an earlier version are still accepted and use the standard report path (no live accumulator) until they are rebuilt.
### Documentation sentences removed by this change
Stale references to `intraday_grid_clock_ms` are replaced with `intraday_bucket`, the requested-bar grid implementation. Source references are refreshed throughout, including the native example batch test registration.
### Validation
All eight verification steps passed on Linux x86-64: preflight, Release, Debug, sanitizers, kernel, documentation, corpus parity and subset. The ABI layout probe passed in Release, Debug and sanitizers. On aarch64, the quantity-step tape/API tests passed three of three and the layout/report integration tests passed three of three, with zero skips. The full-population parity sweep completed; the required parity carry verdict follows publication.
Commits:
- 92db48b Add test: a later same-id entry replaces the earlier priced entry hel…
- d6b0404 Drop the held priced entry when a later same-id opening is accepted
- 4c8e027 Test: label the controls and the sequence guard, assert the resting l…
- 16b9e22 Limit the held-entry cleanup to an accepted strategy.entry
- 727c1d5 Test: do not check the pending count of the rows with the old id stil…
- a3108c1 Re-pin the two quiet-bar random runs that held the lost-market-entry …
- f5a64cc tests: red-first rows for the quantity step declared as mincontract
- eae7b09 Use a declared mincontract as the quantity step when no qty_step is d…
- 031e2a2 tests: the quantity step on handles that declare mincontract
- fec17b6 docs: say where the API defines the quantity step, and name the floor…
- 27583ab Add test: a settled entry occupies its pyramiding slot before its fil…
- 7bfa51a Count a settled opening against the pyramiding cap during fill recalc…
- 0b00663 Move the reused-id rows out of the pyramiding-slot test
- 0fde717 Add a large-book row for the pyramiding-slot count
- 7e35203 Re-pin the reversals seed-1780393 transcript digest after the pyramid…
- 069b2d3 Fix the large-book test's count of resting limits
- db2fa70 Match the large-book test's resting limits at the adapter's own trigg…
- 5fdafcd tests: red-first rows for the requested-bar grid on non-dividing time…
- dec9009 Anchor intraday request buckets to session days
- 040d51d Keep intraday bucket ends at or after their opens
- 9ae8af5 Move default-context equity controls out of the grid target
- 04c4997 Glue: regenerate shared pins and re-anchor the final combined tree
- b406ed5 Glue: name the superseded fixed-runner documentation
- aeb7280 Update three scoped site identities of the source-bound inventory aft…
- 5161e54 Glue: version the live engine layout and cover old-stamp report fallback
- f88d96c Docs: refresh the native example test registration anchor
- 179f76a Tests: refresh the host adapter offset after timeframe state growth
Merged by spark L6 (11-03 23:43): pineforge/verify (8/8 steps on tree 61fada6, verdict 10ba8bcf) and pineforge/parity (carry of sweep train1100-f88d96ca 134/134, no-improve-no-regression, verdict 96253a9f) posted from recorded evidence; all 14 check runs green on the head; main e11b261 unchanged since the gate; REV GO 23:20. [skip ci]: the same tree's full proof already passed (owner 11-03 22:05: one proof per gate).
Co-Authored-By: Claude Opus 5.5 <[email protected]>1 parent e11b261 commit 9fa1ac5
41 files changed
Lines changed: 7290 additions & 242 deletions
File tree
- ci
- docs
- adr
- design
- pages
- include/pineforge
- runner
- scripts
- src
- source
- tests
- cr150.d
- fixtures
- qty_step_mincontract/btc60/feed
- requested_bar_grid/btc60/feed
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
26939 | 26939 | | |
26940 | 26940 | | |
26941 | 26941 | | |
26942 | | - | |
| 26942 | + | |
26943 | 26943 | | |
26944 | 26944 | | |
26945 | 26945 | | |
| |||
31839 | 31839 | | |
31840 | 31840 | | |
31841 | 31841 | | |
31842 | | - | |
| 31842 | + | |
31843 | 31843 | | |
31844 | 31844 | | |
31845 | 31845 | | |
| |||
31852 | 31852 | | |
31853 | 31853 | | |
31854 | 31854 | | |
31855 | | - | |
| 31855 | + | |
31856 | 31856 | | |
31857 | 31857 | | |
31858 | 31858 | | |
| |||
Large diffs are not rendered by default.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
341 | 341 | | |
342 | 342 | | |
343 | 343 | | |
344 | | - | |
| 344 | + | |
345 | 345 | | |
346 | 346 | | |
347 | 347 | | |
348 | 348 | | |
349 | 349 | | |
350 | 350 | | |
351 | | - | |
| 351 | + | |
352 | 352 | | |
353 | 353 | | |
354 | 354 | | |
| |||
381 | 381 | | |
382 | 382 | | |
383 | 383 | | |
384 | | - | |
| 384 | + | |
385 | 385 | | |
386 | 386 | | |
387 | 387 | | |
| |||
0 commit comments