calc_strat_unwt_return | R Documentation |
Calculate unweighted returns given weighted returns and size of strategies
calc_strat_unwt_return(wt_return, strat_headline_size)
wt_return |
A dataframe containing the timeseries weighted return of the strategies, recommended to be simulated returns, so that unweighted return for all of history can be obtained |
strat_headline_size |
A dataframe containing the timeseries headline sizes of the trades. Should be all in percent. Recommended to be simulated sizes, needs to correspond to 'wt_return' |
A dataframe containing the timeseries unweighted return of the strategies
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) calc_strat_unwt_return(wt_return, headline_size) # With Bloomberg portfolios <- build_strategies(demo_strategies) dur <- get_dur_bbg(portfolios$summary) sim_pf_size <- convert_dur_size(portfolios$sim, portfolios$summary, dur) ret <- get_ret_bbg(portfolios$summary) wt_return <- calc_strat_wt_return(sim_pf_size, ret) headline_size <- calc_strat_headline_size(sim_pf_size) calc_strat_unwt_return(wt_return, headline_size)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.