Function to get equal-weighted (zero-cost) long-short wts from selected groupings of multi-ranked variables.
1 | get_weights_mr(mranks, long_g, short_g, long_only = FALSE)
|
For example, if one wanted to long high momentum stocks with positive news and short negative momentum stocks with negative news, one could sort the top (bottom) quintile (1/5) of momentum stocks on news tone and long (short) the top (bottom) tercile (1/3). Weights for this could be calculated as follows: mr <- multiRank(Vars=list(momentum_ranks, news_ranks), groupings = c(5,3)) wts <- get_weights(mr, long_g=c(1,1), short_g=c(5,3))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.