View source: R/backtestSummary.R
backtestSelector | R Documentation |
Select the results from a portfolio backtest.
backtestSelector( bt, portfolio_index = NULL, portfolio_name = NULL, measures = NULL )
bt |
Backtest results as produced by the function |
portfolio_index |
Index number of a portfolio, e.g., |
portfolio_name |
String name of a portfolio, e.g., |
measures |
String vector to select performane measures (default is all) from
|
List with the following elements:
|
Performance measures selected by argument |
|
Error status ( |
|
Error messages generated by portfolio function over each dataset. Useful for debugging purposes. |
|
CPU usage by portfolio function over each dataset. |
|
Portfolio weights generated by portfolio function over each dataset. |
|
Portfolio returns over each dataset. |
|
Portfolio wealth (aka cumulative returns or cumulative P&L) over each dataset. |
Rui Zhou and Daniel P. Palomar
library(portfolioBacktest) data("dataset10") # load dataset # define your own portfolio function EWP_portfolio <- function(dataset, ...) { N <- ncol(dataset$adjusted) return(rep(1/N, N)) } # do backtest bt <- portfolioBacktest(list("EWP" = EWP_portfolio), dataset10) # extract your interested portfolio result bt_sel <- backtestSelector(bt, portfolio_name = "EWP") names(bt_sel)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.