Takes an xts of ranks and returns an xts object containing position sizes (weights) for an equal weighted long-short portfolio.
1 | get_weights_ls(ranks, TopN)
|
ranks |
xts object containing asset ranks. Column names are assumed to be independent assets. |
TopN |
Number of assets on each side (long or short) of trade (integer). Total number of assets held each period will be TopN*2 #' @importFrom zoo index |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.