calc_strat_unwt_return: Calculate unweighted returns given weighted returns and size...

calc_strat_unwt_returnR Documentation

Calculate unweighted returns given weighted returns and size of strategies

Description

Calculate unweighted returns given weighted returns and size of strategies

Usage

calc_strat_unwt_return(wt_return, strat_headline_size)

Arguments

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'

Value

A dataframe containing the timeseries unweighted return of the strategies

Examples

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)


yunching/tidymas documentation built on Feb. 5, 2023, 1:42 p.m.