-
Notifications
You must be signed in to change notification settings - Fork 9
/
initAcct.Rd
60 lines (49 loc) · 2.16 KB
/
initAcct.Rd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
% Generated by roxygen2 (4.0.2): do not edit by hand
\name{initAcct}
\alias{initAcct}
\title{Constructs the data container used to store calculated account values such as aggregated P&L, equity, etc.}
\usage{
initAcct(name = "default", portfolios, initDate = "1950-01-01",
initEq = 0, currency = "USD", ...)
}
\arguments{
\item{name}{Account name, as string}
\item{portfolios}{character vector of strigs naming portfolios included in this account}
\item{initDate}{A date prior to the first close price given, used to contain initial account equity and initial position}
\item{initEq}{initial account equity in the currency of the portfolio, as a floating point number.}
\item{currency}{ISO currency identifier used to locate the portfolio currency}
\item{\dots}{any other passthrough parameters}
}
\description{
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
}
\details{
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
}
\note{
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.
}