PIX-14540: bound trend-aligned local stop bypass #611

Open
andrei wants to merge 2 commits from agent/devops/pix-14540-local-stop-trend-aligned into master
Owner

Исправляет blocker из review PR #610 по exact SHA ae79dd95e4.

Что изменено:

  • neutral/ranging больше не считаются trend-aligned для local stop, путь fail-closed;
  • trend-aligned leg при обычном breach теперь сначала отменяет expanding orders этой стороны, затем пишет audit reason local_stop_trend_aligned и удерживает позицию;
  • добавлен hard cap: если trend-aligned loss превышает 3x обычного LOCAL_STOP_NOTIONAL_RATIO лимита, leg закрывается штатным reduceOnly market close;
  • добавлены симметричные тесты long/short для cancel-before-keep, hard-cap close и neutral/ranging fail-closed.

Проверка:

  • /srv/apps/arnold-trader/venv/bin/python -m pytest backend/tests/test_grid_short_guard.py -q -> 38 passed;
  • git diff --check -> clean;
  • gitnexus impact/detect-changes недоступны из-за локальной ошибки индекса: analyze падает на DuckDB/FTS COPY failed for File: ... extension is not loaded, impact/detect-changes возвращают No indexed repositories found.
Исправляет blocker из review PR #610 по exact SHA ae79dd95e4058d2daae6c635e673a09550ab838b. Что изменено: - neutral/ranging больше не считаются trend-aligned для local stop, путь fail-closed; - trend-aligned leg при обычном breach теперь сначала отменяет expanding orders этой стороны, затем пишет audit reason local_stop_trend_aligned и удерживает позицию; - добавлен hard cap: если trend-aligned loss превышает 3x обычного LOCAL_STOP_NOTIONAL_RATIO лимита, leg закрывается штатным reduceOnly market close; - добавлены симметричные тесты long/short для cancel-before-keep, hard-cap close и neutral/ranging fail-closed. Проверка: - /srv/apps/arnold-trader/venv/bin/python -m pytest backend/tests/test_grid_short_guard.py -q -> 38 passed; - git diff --check -> clean; - gitnexus impact/detect-changes недоступны из-за локальной ошибки индекса: analyze падает на DuckDB/FTS `COPY failed for File: ... extension is not loaded`, impact/detect-changes возвращают `No indexed repositories found`.
fix(grid): keep trend-aligned local stop legs
All checks were successful
Arnold Forgejo CI / backend-tests (pull_request) Successful in 12m13s
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 1s
ae79dd95e4
fix(grid): bound trend-aligned local stop bypass
Some checks failed
Arnold Forgejo CI / backend-tests (pull_request) Failing after 6m17s
Arnold Forgejo CI / frontend-audit (pull_request) Successful in 17s
Arnold Forgejo CI / secret-scan (pull_request) Successful in 3s
Forgejo Smoke Test / Smoke (pull_request) Successful in 1s
3673e56cf9
Some checks failed
Arnold Forgejo CI / backend-tests (pull_request) Failing after 6m17s
Arnold Forgejo CI / frontend-audit (pull_request) Successful in 17s
Arnold Forgejo CI / secret-scan (pull_request) Successful in 3s
Forgejo Smoke Test / Smoke (pull_request) Successful in 1s
This pull request has changes conflicting with the target branch.
  • backend/tests/test_grid_short_guard.py
View command line instructions

Manual merge helper

Use this merge commit message when completing the merge manually.

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin agent/devops/pix-14540-local-stop-trend-aligned:agent/devops/pix-14540-local-stop-trend-aligned
git switch agent/devops/pix-14540-local-stop-trend-aligned

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch master
git merge --no-ff agent/devops/pix-14540-local-stop-trend-aligned
git switch agent/devops/pix-14540-local-stop-trend-aligned
git rebase master
git switch master
git merge --ff-only agent/devops/pix-14540-local-stop-trend-aligned
git switch agent/devops/pix-14540-local-stop-trend-aligned
git rebase master
git switch master
git merge --no-ff agent/devops/pix-14540-local-stop-trend-aligned
git switch master
git merge --squash agent/devops/pix-14540-local-stop-trend-aligned
git switch master
git merge --ff-only agent/devops/pix-14540-local-stop-trend-aligned
git switch master
git merge agent/devops/pix-14540-local-stop-trend-aligned
git push origin master
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!611
No description provided.