Skip to content

fix: preserve representable 0.01-lot grid points in money sizing - #206

Merged
luisleo526 merged 2 commits into
mainfrom
round22/cent-lot-scale
Sep 7, 2026
Merged

fix: preserve representable 0.01-lot grid points in money sizing#206
luisleo526 merged 2 commits into
mainfrom
round22/cent-lot-scale

Conversation

@luisleo526

Copy link
Copy Markdown
Collaborator

Division by binary64 0.01 could floor a quantity one lot below a grid point that the input already represents. The money-sizing helper now checks an exact scale-of-100 candidate and accepts it only when the reconstructed grid quantity does not exceed the input. This adds no epsilon and preserves the existing under-floor controls and other lot sizes.

Validated on engine a03ac6d3fb42df5af1db9e39727daf450b2fb71f with codegen 3fd97fe28abd7b191cb376d9f5db4e056fcfae4b:

  • Cloud Run measured all 4,190 probes in 72/72 cases. SERHAN1 EURUSD moves from strong to excellent: canonical count difference 1 to 0 and match 99.8% to 100%. The other 4,189 canonical results are unchanged, with zero regressions, errors or gaps. Result: 4,164 excellent / 26 strong / zero moderate.
  • The target matches TradingView on side, time, price and quantity for 2,219 of 2,220 entry/exit rows. Only the existing final range-end price mark differs; the missed close, re-entry and subsequent quantities are restored.
  • Gate pineforge-pr-gate-h59tq: PASS, target score +1, and zero regressions or tolerated exceptions across 704 hard probes.
  • Fresh build and 214/214 tests passed, including the existing money-precision and band controls. Covered TradingView quantity and capital controls confirm the boundary. Independent Grok 4.6 review of this exact candidate is GREEN, P0/P1/P2 = 0.

Grading metrics, thresholds, tolerances, verifier, harness, tapes and population are unchanged. An unconditional scale-of-100 version was rejected because it broke an existing TradingView control; the guarded version preserves that control.

Candidate snapshot: f9f708d622270b207b1234b8f8031a237a3499391a29e6377233c3d5d90bfc9b (788,855 bytes).

@luisleo526
luisleo526 merged commit a03ac6d into main Sep 7, 2026
8 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