Skip to content

Teach risk rules and stateful strategy behavior #114

Closed

Description

@stefan-jansen

Affected library: backtest
Current version: 0.1.8
Location: risk and stateful-strategy tutorial

Problem

Readers cannot see how stops, exits, portfolio drawdown reduction, and strategy state interact across callbacks and fills.

Required outcome

Build a runnable tutorial showing causal risk-event order, the resulting stop and reduction fills, and a strategy that needs state between callbacks. Connect it to the risk-management guide, the existing stateful example, and relevant book material.

Acceptance criteria

  • Executed results show the expected stop and reduction fills, fraction, and exposure change.
  • A repeated breach and a later eligible risk event produce the documented behavior.
  • The page explains the order of marks, checks, decisions, and fills using the observed records.
  • Installed-wheel checks and the strict MkDocs build pass.

Depends on the portfolio-reduction fix and shared tutorial inputs.

Activity

  1. added a commit that references this issue on Sep 24, 2026
    71aad3e
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions