portfolio: Build Portfolio Dataset

Description Usage Arguments Details Value See Also

View source: R/portfolio.R

Description

This function is the creator of an S3 class of structured dataset for a portfolio.

Usage

1
portfolio(data, Names, weights, V0 = 1)

Arguments

data

an object that contains the components of the portfolio.

Names

a character vector indicating the components of the portfolio.

weights

an object of class pfWeight, or a numerical vector (see Details).

V0

the total value of the portfolio.

Details

This function, together with stocks and addOptions, forms the bottom layer of the risk calculation system, which performs data structuring.

This function subsets the data and only keeps the components of the portfolio (and the underlyings if components are options).

The function support portfolio weights defined both in value and number of shares, which is supported by portfolioWeight function. If weights is a numerical vector, it is regarded as portfolio weights in value, not in number of shares.

Value

An object of class portfolioData.

See Also

stocks, addOptions, GBM, portfolioWeight


zhangkd5/riskCalc documentation built on May 4, 2019, 10:16 p.m.