init_strategy: Initialize a strategy object

Description Usage Arguments Details Value Examples

Description

The strategy() function creates a strategy object (of S3 class fc_strategy), a container that holds all of the data, rules, and parameters for the strategy being backtested. The function takes just one argument, universe, which must be a character vector of the securities to be included in the strategy.

Usage

1
init_strategy(universe)

Arguments

universe

a character vector of the securities to be included in the strategy.

Details

Further, the securities named in universe must exist as objects in the global environment containing the data for the backtest. For instance, a strategy being run on AAPL must have "AAPL" in the universe vector and must have an object named AAPL that contains the stock price data for AAPL.

Value

a strategy object

Examples

1
2
data(SPY)
strat <- init_strategy("SPY")

jonaselm/fluxcapacitor documentation built on May 16, 2019, 2:53 a.m.