fix(grid): enforce normal local stop cap in aligned trends #626

Merged
andrei merged 2 commits from fix/grid-normal-local-stop-cap-20260805 into master 2026-08-05 00:44:47 +00:00
Owner

Причина

Production attribution: Grid had 799 winning and 95 losing closes over 30d, but average loss (-$2.2726) was ~28x average win (+$0.0801). The trend-aligned local-stop exception deferred closure from the normal cap to 2x, preserving destructive tail losses. Latest observed AVAX LONG soft threshold was ~$0.81 and eventual stop about -$1.78.

Исправление

  • remove the 2x trend-aligned local-stop allowance
  • close every breached grid-owned leg at max($0.50, 0.5% notional)
  • preserve expanding-order cancellation, ownership isolation, counter-trend preflight, reduceOnly close, and same-regime reentry latch
  • add observed AVAX LONG and mirrored SHORT regressions

Проверка

  • RED reproduced before code change
  • focused grid/counter-trend suite: 616 passed with RuntimeWarning as errors
  • py_compile and diff-check: green
  • diff-only gitleaks: no leaks
  • full backend suite: running; merge remains blocked until exact green result and independent review
## Причина Production attribution: Grid had 799 winning and 95 losing closes over 30d, but average loss (-$2.2726) was ~28x average win (+$0.0801). The trend-aligned local-stop exception deferred closure from the normal cap to 2x, preserving destructive tail losses. Latest observed AVAX LONG soft threshold was ~$0.81 and eventual stop about -$1.78. ## Исправление - remove the 2x trend-aligned local-stop allowance - close every breached grid-owned leg at max($0.50, 0.5% notional) - preserve expanding-order cancellation, ownership isolation, counter-trend preflight, reduceOnly close, and same-regime reentry latch - add observed AVAX LONG and mirrored SHORT regressions ## Проверка - RED reproduced before code change - focused grid/counter-trend suite: 616 passed with RuntimeWarning as errors - py_compile and diff-check: green - diff-only gitleaks: no leaks - full backend suite: running; merge remains blocked until exact green result and independent review
fix(grid): enforce normal local stop cap in aligned trends
Some checks failed
Arnold Forgejo CI / backend-tests (pull_request) Successful in 12m22s
Arnold Forgejo CI / frontend-audit (pull_request) Failing after 19s
Arnold Forgejo CI / secret-scan (pull_request) Successful in 3s
Forgejo Smoke Test / Smoke (pull_request) Successful in 1s
40477c93e7
Author
Owner

Exact HEAD 40477c93e7 local authoritative verification completed:

  • full backend: 7554 passed, 7 skipped, exit 0
  • focused Grid/counter-trend: 616 passed with RuntimeWarning as errors
  • py_compile + diff-check: green
  • diff-only gitleaks: no leaks
    Independent adversarial review and Forgejo CI remain required before merge.
Exact HEAD 40477c93e71613c8a9776fcd9869646befb44d85 local authoritative verification completed: - full backend: 7554 passed, 7 skipped, exit 0 - focused Grid/counter-trend: 616 passed with RuntimeWarning as errors - py_compile + diff-check: green - diff-only gitleaks: no leaks Independent adversarial review and Forgejo CI remain required before merge.
Author
Owner

Independent adversarial review of exact trading SHA 40477c93e7: GREEN, no blocking findings. Reviewer confirmed normal 0.5%/$0.50 cap, ownership isolation, fail-closed cancel/ownership behavior, preflight, reduceOnly close, successful-close-only latch persistence, and AVAX LONG regression shape. The only failed CI context belongs to the unchanged dependency baseline and is actively repaired in PR #627.

Independent adversarial review of exact trading SHA 40477c93e71613c8a9776fcd9869646befb44d85: GREEN, no blocking findings. Reviewer confirmed normal 0.5%/$0.50 cap, ownership isolation, fail-closed cancel/ownership behavior, preflight, reduceOnly close, successful-close-only latch persistence, and AVAX LONG regression shape. The only failed CI context belongs to the unchanged dependency baseline and is actively repaired in PR #627.
merge: refresh Grid stop fix on audited master
All checks were successful
Arnold Forgejo CI / backend-tests (pull_request) Successful in 12m20s
Arnold Forgejo CI / frontend-audit (pull_request) Successful in 18s
Arnold Forgejo CI / secret-scan (pull_request) Successful in 3s
Forgejo Smoke Test / Smoke (pull_request) Successful in 2s
cf1716972b
Author
Owner

PR #627 merged to master at 00782249dd after exact-head GREEN and full CI success. PR #626 is refreshed via conflict-free merge; new exact HEAD cf1716972b contains independently GREEN trading parent 40477c93e and dependency parent f5ed46e61. Fresh exact-head CI and final integration review are running. Do not merge earlier 40477c93 head status.

PR #627 merged to master at 00782249ddc0f01219ff51d3ed56e2ef5598aeab after exact-head GREEN and full CI success. PR #626 is refreshed via conflict-free merge; new exact HEAD cf1716972bd8721d9127b6a5ab69848f7ab3117d contains independently GREEN trading parent 40477c93e and dependency parent f5ed46e61. Fresh exact-head CI and final integration review are running. Do not merge earlier 40477c93 head status.
Author
Owner

Final integration review of exact HEAD cf1716972b: GREEN, no blockers. Reviewer recomputed merge tree (exact match), confirmed no changed-path overlap, and verified both trading and dependency patches are byte-for-byte unchanged. Awaiting only exact-head Forgejo CI.

Final integration review of exact HEAD cf1716972bd8721d9127b6a5ab69848f7ab3117d: GREEN, no blockers. Reviewer recomputed merge tree (exact match), confirmed no changed-path overlap, and verified both trading and dependency patches are byte-for-byte unchanged. Awaiting only exact-head Forgejo CI.
andrei merged commit 26b70412cf into master 2026-08-05 00:44:47 +00:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
europa-tech-srl/arnold-trader-app!626
No description provided.