Description Usage Arguments Details Value Examples
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.
1 | init_strategy(universe)
|
universe |
a character vector of the securities to be included in the strategy. |
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.
a strategy object
1 2 | data(SPY)
strat <- init_strategy("SPY")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.