Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Strategy

Defines a strategy that can be back-tested.

Hierarchy

  • Strategy

Index

Constructors

Properties

Accessors

Methods

Constructors

constructor

  • Creates a strategy with definition and indicators.

    Parameters

    • name: string

      Name of the strategy.

    • define: (quote: Quote) => StrategyPoint | undefined

      Strategy definition function that accepts a Quote and returns a PositionType.

    • indicators: Indicator<any>[]

      Array of Indicator that can be used to determine the position in this strategy.

    Returns Strategy

Properties

Protected _define

_define: (quote: Quote) => StrategyPoint | undefined

Type declaration

Protected _indicators

_indicators: Indicator<any>[]

Protected _name

_name: string

Accessors

indicators

name

  • get name(): string

Methods

apply

  • Applies the strategy over a given quote and returns the strategy values.

    Parameters

    • quote: Quote

      Quote on which strategy should be applied.

    Returns undefined | StrategyPoint

    StrategyPoint.

backtest

  • Backtests the strategy over a given Dataset and configuration, and returns the report.

    Parameters

    • dataset: Dataset

      Dataset on which strategy should be applied over each quote.

    • configuration: BacktestConfiguration

      BacktestConfiguration that configures the backtest.

    Returns BacktestReport

    BacktestReport.

Generated using TypeDoc