calcPortfWgt: Calculates the portfolio weights for positions within a given...

View source: R/calcPortfWgt.R

calcPortfWgtR Documentation

Calculates the portfolio weights for positions within a given portfolio.

Description

Portfolio weights may be calculated differently depending on their use. By default, this function uses denominator of 'Gross.Value', the second most common option will likely be 'Net.Value'. For separating long and short weights, 'Long.Value' and 'Short.Value' may be needed as denominators.

Usage

calcPortfWgt(Portfolio, Symbols = NULL, Dates = NULL,
  denominator = c("Gross.Value", "Net.Value", "Long.Value", "Short.Value"),
  Account)

Arguments

Portfolio

a portfolio object structured with initPortf()

Symbols

an instrument identifier for a symbol included in the portfolio

Dates

dates to return the calculation over formatted as xts range

denominator

string describing the deniminator, see Description

Account

an Account object containing Portfolio summaries

Value

xts timeseries object with weights by date in rows and symbolname in columns


braverock/blotter documentation built on Feb. 13, 2023, 1 p.m.