PortfReturns: Calculate portfolio instrument returns

PortfReturnsR Documentation

Calculate portfolio instrument returns

Description

This function (for now) calculates return on initial equity for each instrument in the portfolio or portfolios that make up an account. These columns will be additive to return on capital of each portfolio, or of the entire account.

Usage

PortfReturns(Account, method = c("contribution"), ..., Dates = NULL,
  Portfolios = NULL, period = c("daily", "none"))

Arguments

Account

string name of the account to generate returns for

method

for now, only 'contribution' is supported

...

any other passthru parameters (like native for .getBySymbol

Dates

xts style ISO 8601 date subset to retrieve, default NULL (all dates)

Portfolios

concatenated string vector for portfolio names to retrieve returns on, default NULL (all portfolios)

period

one of daily

Details

This function exists because of R/Finance community requests by Mark Breman and Thomas Bolton

Note

TODO handle portfolio and account in different currencies (not hard, just not done)

TODO explicitly handle portfolio weights

TODO provide additional methods of calculating returns

TODO support additions and withdrawals to available capital


braverock/blotter documentation built on Sept. 15, 2024, 8:45 p.m.