Skip to content

Correct User Guide API examples and stateful claims - #122

Merged
stefan-jansen merged 8 commits into
mainfrom
docs/stateful-claim-correction
Sep 24, 2026
Merged

stefan-jansen merged 8 commits into
mainfrom
docs/stateful-claim-correction

Conversation

@stefan-jansen

@stefan-jansen stefan-jansen commented Sep 24, 2026 •

Copy link
Copy Markdown
Contributor

Why

The published Stateful Strategies guide and linked example module say VectorBT cannot model decisions that depend on simulated fills. VectorBT's documented Portfolio.from_order_func supports state-dependent order generation. The pairs example also presents independent orders without guaranteeing both legs fill. The Accounts guide passes account settings as unsupported Engine constructor keywords. The Risk Management guide contains 11 unsupported rule and limit keywords and describes an ATR stop as a standard-deviation stop.

Changes

  • Explain the distinction between precomputed order arrays and callback-based simulation, with a link to VectorBT's public API documentation.
  • Replace absolute claims across five stateful patterns and the related example/test docstrings.
  • State that the pairs example submits independent orders and requires fill and rejection inspection.
  • Narrow the SAME_BAR comparison text to explicit timing settings.
  • Correct the Accounts guide to pass account policy through BacktestConfig, and run its standalone short-sale example in the installed-wheel documentation check.
  • Correct the Gatekeeper example to supply an account, commission model, and expected fill price; check its cash rejection against the installed wheel.
  • Correct risk rule and limit constructor names and their described semantics. Add eight risk blocks to the installed-wheel example check.
  • Express market-impact formulas in the price units returned by the models and document the square-root model's configured volatility and daily-volume multiplier.
  • Check direct imported public API calls in all homepage and User Guide Python blocks against installed package signatures in CI.
  • Regenerate the v0.1 compatibility snapshot for the accounting symbols now documented as public imports: AccountState, UnifiedAccountPolicy, and NoCommission.

Verification

  • uv run mkdocs build --strict passed.
  • validation/check_documentation_links.py checked 2,041 rendered guide links and 30 external destinations.
  • validation/check_book_links.py checked 22 pinned companion paths.
  • The required documentation example set, including both new Accounts examples and eight risk examples, passed locally. The signature audit parsed 145 Python blocks and checked 142 direct imported calls across consecutive blocks with no remaining signature errors. The focused documentation and risk tests (103 tests), impact and documentation tests (35 tests), the stable compatibility boundary tests (8 tests), and pre-commit passed. CI will validate the installed wheel and full test suite.

Refs #120. These corrections do not close the full User Guide audit.

Copilot AI lite review requested due to automatic review settings September 24, 2026 14:56

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@stefan-jansen stefan-jansen changed the title Correct stateful simulation claims in the guide Correct User Guide API examples and stateful claims Sep 24, 2026
@stefan-jansen
stefan-jansen merged commit 6a1974b into main Sep 24, 2026
43 checks passed
@stefan-jansen
stefan-jansen deleted the docs/stateful-claim-correction branch September 24, 2026 16:44
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.

2 participants