Skip to content

Create context Field Inside Strategy #6

@maxholloway

Description

@maxholloway

Create context Field Inside Strategy

Motivation

There may be things that a user wants to store throughout the backtest to use across various methods.

Interface

A dictionary called context that lives in the Strategy compound type.

Implementation

  1. Add an optional context argument to the StrategyOptions constructor, and update the StrategyOptions type definition to reflect this change.
  2. [Optional] Modify the function signatures for user-defined so that context was explicitly passed as an argument. This would make it clearer than accessing it via strat.options.context, which may be unclear from a developer's perspective (i.e. users may ask "Why is context stored in the options namespace"?).

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestgood first issueGood for newcomersp2High Priority (priority 2)

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions