Description Usage Arguments Details Note
Inputs portfolios: a list of portfolio object names to attach to the account initDate: date prior to the first close price given, used to contain initial account equity and initial position initEq: initial equity or starting capital, default is 100,000
1 2 |
name |
Account name, as string |
portfolios |
character vector of strigs naming portfolios included in this account |
initDate |
A date prior to the first close price given, used to contain initial account equity and initial position |
initEq |
initial account equity in the currency of the portfolio, as a floating point number. |
currency |
ISO currency identifier used to locate the portfolio currency |
... |
any other passthrough parameters |
Outputs Constructs multi-column xts object used to store aggregated portfolio calculations
NOTES An Account object is a list of portfolios with portfolio summary information
The Account object is modeled on the CFTC Thirteen-column presentation table. Start with the CFTC six column presentation, which includes: Beg.Eq, Additions, Withdrawals, Net.Perf, End.Eq, Period.ROR No reason to persist Period.ROR, and Beg.Eq = Previous End.Eq, So we're left with four columns. Note that Period.ROR can be calc'd several different ways and is best left as a function.
To get to the CFTC thirteen columns add: Gross.Realized, Commission, Net.Realized, Interest, Ch.Unrealized, Advisory.Fees, Wealth.Index Again, no need to add Wealth.Index. Eventually, these additional columns will be useful. Gross.Realized will be calculated as (Net) Realized.PL + Txn.Fees
TODO Add calcPeriodROR function
TODO Adddd functions addCapital, drawCapital, addFees
initDate and initEq can be used in addCapital to initalize the account? Track cash at this level??? Calc gross PL and subtract fees? Or calc net PL and add fees.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.