simulate_history | R Documentation |
Calculate the returns in history given a set of static strategy weights
simulate_history(unwt_ret, curr_wt, start_date, end_date)
unwt_ret |
A dataframe containing the timeseries unweighted return of strategies, with columns 'date', 'strategy', 'return' |
curr_wt |
A dataframe weights of strategies with columns 'strategy', 'size' |
start_date |
A Date variable indicating the start period of simulation |
end_date |
A Date variable indicating the end period of simulation |
A dataframe containing the timeseries weighted return of the period
portfolios <- build_strategies(demo_strategies, as.Date("2016-01-01"), as.Date("2018-12-07")) sim_pf_size <- convert_dur_size(portfolios$sim, portfolios$summary, demo_duration) wt_return <- calc_strat_wt_return(sim_pf_size, demo_return) headline_size <- calc_strat_headline_size(sim_pf_size) unwt_return <- calc_strat_unwt_return(wt_return, headline_size) curr_wt <- get_strat_size(headline_size, as.Date("2018-01-05")) simulate_history(unwt_return, curr_wt, as.Date("2016-01-01"), as.Date("2018-01-01"))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.