Skip to content

TEST: Cover absolute-size margin warning - #1377

Merged
kernc merged 1 commit into
kernc:masterfrom
initial-d:test-absolute-size-margin-warning
Jul 22, 2026
Merged

TEST: Cover absolute-size margin warning#1377
kernc merged 1 commit into
kernc:masterfrom
initial-d:test-absolute-size-margin-warning

Conversation

@initial-d

@initial-d initial-d commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

Adds a regression test for absolute-sized orders that are canceled because there is not enough margin.

This covers the behavior discussed in #1360. The implementation on current 'master' already emits a UserWarning for the absolute-size path; this test makes that behavior explicit and keeps it aligned with the existing relative-size warning path.

Validation:

  • 'python -m py_compile backtesting/test/_test.py' passes
  • 'git diff --check' passes
  • Tried to run the targeted unittest locally, but the available Python environment was missing test/runtime dependencies such as 'bokeh'. I started a local .venv install, but dependency installation took too long in this environment, so I left full execution to CI.

Fixes #1360

@initial-d
initial-d force-pushed the test-absolute-size-margin-warning branch from 41f85c8 to acd8c55 Compare July 22, 2026 06:24
@kernc

kernc commented Jul 22, 2026

Copy link
Copy Markdown
Owner

Ah, thanks for checking (and proving) that!

@kernc
kernc merged commit e6e0299 into kernc:master Jul 22, 2026
8 checks passed
@initial-d

Copy link
Copy Markdown
Contributor Author

Thanks for merging it, and thanks for the quick review.

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.

Silent order cancellation for absolute-sized orders with insufficient margin (no warning emitted)

2 participants