Skip to content

Lifecycle Components

Lifecycle components let you move strategy lifecycle code out of a large inline Strategy implementation and into smaller AQE components. You can still write the same logic directly inside on_start, init, on_teardown, and universe; the component model exists to make projects easier to segment, test, reuse, and expose in AQS.

Use these pages as the entry point for modular lifecycle work:

  • Strategy lifecycle flow explains the order AQE runs strategy hooks, lifecycle logic, universe loading, bars, and teardown.
  • Lifecycle logic covers OnStartLogic, OnInitLogic, OnTeardownLogic, timing, failure policy, and registration.
  • Universe models covers modular symbol selection and how universe model results merge with inline Strategy::universe.
  • Runtime state covers ctx.variables() and where mutable runtime bookkeeping belongs.

Prefer lifecycle components and universe models when code has a clear module boundary, needs to be visible in AQS, has its own constructor configuration, or should be reused between strategies.