Skip to content

fix(trading): validate grid startup and suppress repeated residual exits - #396

Merged
brokermr810 merged 72 commits into
mainfrom
test
Nov 21, 2026
Merged

brokermr810 merged 72 commits into
mainfrom
test

Conversation

@brokermr810

Copy link
Copy Markdown
Collaborator

Summary

  • Validate every funded resting-grid cell against native quantity steps, minimum quantities and minimum notionals before opening an initial market position. Use actual cell weights, contract sizing, swap leverage and paired exit prices without enlarging orders or budgets.
  • Reject empty or unverified startup coverage instead of reporting a running grid with no working orders. Retain verified exit orders during recovery and preserve rollback of newly seeded exposure after later placement failures.
  • Include the previously pushed residual-exit fix on test: suppress repeated unchanged below-minimum exit requests and deduplicate equivalent failure notifications without deleting holdings or inventing fills.
  • Update English and Chinese live-trading safety documentation.

Verification

  • 280 offline grid regression tests passed, excluding live-exchange tests and with container networking disabled.
  • Ruff critical lint, backend structure guardrail, documentation checks and git diff --check passed.
  • DCO sign-off included.

Deployment and remaining risk

Backend-only changes; no database migration or frontend changes. Deploy the updated backend/trading worker image after review. No live accounts were accessed or traded during verification. Preflight does not reserve margin or guarantee venue acceptance; insufficient margin and later exchange failures remain subject to existing failure and rollback handling.

tianhe added 30 commits November 1, 2026 17:17
Signed-off-by: TIANHE <[email protected]>

# Conflicts:
#	backend_api_python/app/routes/community.py
tianhe and others added 27 commits November 14, 2026 13:41
Signed-off-by: TIANHE <[email protected]>

# Conflicts:
#	backend_api_python/tests/test_safe_exec.py
#	backend_api_python/tests/test_strategy_runtime_process_isolation.py
Signed-off-by: TIANHE <[email protected]>

# Conflicts:
#	backend_api_python/app/professional_report/features/equity.py
#	backend_api_python/app/research/workflows.py
#	backend_api_python/tests/test_professional_report_builder.py
@sonarqubecloud

Copy link
Copy Markdown

@codecov

codecov Bot commented Nov 21, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 92.07317% with 13 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
.../app/services/pending_orders/live_order_support.py 83.58% 7 Missing and 4 partials ⚠️
backend_api_python/app/services/grid/engine.py 94.28% 0 Missing and 2 partials ⚠️

📢 Thoughts on this report? Let us know!

@brokermr810
brokermr810 merged commit cf329c4 into main Nov 21, 2026
15 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.

3 participants