[Blotter-commits] r32 - pkg/man

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Tue Dec 23 03:58:51 CET 2008


Author: peter_carl
Date: 2008-12-23 03:58:50 +0100 (Tue, 23 Dec 2008)
New Revision: 32

Modified:
   pkg/man/addTxn.Rd
   pkg/man/calcPortfAttr.Rd
   pkg/man/calcTxnValue.Rd
   pkg/man/getByPortfolio.Rd
   pkg/man/getBySymbol.Rd
   pkg/man/getTxn.Rd
   pkg/man/initAcct.Rd
   pkg/man/updateAcct.Rd
   pkg/man/updatePosPL.Rd
Log:
- initial draft of documentation


Modified: pkg/man/addTxn.Rd
===================================================================
--- pkg/man/addTxn.Rd	2008-12-23 02:55:47 UTC (rev 31)
+++ pkg/man/addTxn.Rd	2008-12-23 02:58:50 UTC (rev 32)
@@ -14,7 +14,7 @@
 }
 %- maybe also 'usage' for other objects documented here.
 \arguments{
-  \item{Portfolio}{ a portfolio object structured with \code{\link{initPortf()}} }
+  \item{Portfolio}{ a portfolio object structured with \code{\link{initPortf}} }
   \item{Symbol}{ an instrument identifier for a symbol included in the portfolio, e.g., "IBM" }
   \item{TxnDate}{ transaction date as ISO 8106, e.g., '2008-09-01'}
   \item{TxnQty}{ total units (such as shares) transacted.  Positive values indicate a 'buy'; negative values indicate a 'sell' }

Modified: pkg/man/calcPortfAttr.Rd
===================================================================
--- pkg/man/calcPortfAttr.Rd	2008-12-23 02:55:47 UTC (rev 31)
+++ pkg/man/calcPortfAttr.Rd	2008-12-23 02:58:50 UTC (rev 32)
@@ -1,99 +1,40 @@
 \name{calcPortfAttr}
 \alias{calcPortfAttr}
-%- Also NEED an '\alias' for EACH other topic documented here.
-\title{ ~~function to do ... ~~ }
+\alias{calcPortfSummary}
+\title{ Calculate summary information for a Portfolio }
 \description{
-  ~~ A concise (1-5 lines) description of what the function does. ~~
+    Calculates the attributes of a portfolio from its positions.
 }
 \usage{
 calcPortfAttr(Portfolio, Attribute, Date = NULL)
+calcPortfSummary(Portfolio, Date = NULL)
 }
-%- maybe also 'usage' for other objects documented here.
 \arguments{
-  \item{Portfolio}{ ~~Describe \code{Portfolio} here~~ }
-  \item{Attribute}{ ~~Describe \code{Attribute} here~~ }
-  \item{Date}{ ~~Describe \code{Date} here~~ }
+  \item{Portfolio}{ The Portfolio object for which to calculate the attribute. }
+  \item{Attribute}{ The attribute of the Portfolio object to calculate. See detail below.}
+  \item{Date}{ The ISO 8601 date to calculate the attribute for.  If no date is specified (NULL by default), the function calculates for all available dates }
 }
 \details{
-  ~~ If necessary, more details than the description above ~~
+Attribute can be any of the following:
+  \item{Long.Value}{ The sum of the notional value of all positions held long in the portfolio.}
+  \item{Short.Value}{The sum of the notional value of all positions held short in the portfolio.} 
+  \item{Net.Value}{The sum of the notional long and notional short value of the portfolio.}
+  \item{Gross.Value}{The sum of the notional long and absolute value of the notional short value of the portfolio.}
+  \item{Txn.Fees}{The sum of brokerage commissions, exchange and other brokerage fees paid by the portfolio during the period.}
+  \item{Realized.PL}{The sum of net realized profits or losses aggregated from the underlying positions in the portfolio.  Gross realized profits can be calculated by adding 'Txn.Fees', the brokerage commission expenses for the period.}
+  \item{Unrealized.PL}{The sum total increase or decrease in unrealized profits or losses on open positions in the portfolio at the end of the period.}
+  \item{Trading.PL}{Net realized profit or loss plus interest income plus change in unrealized profit or loss across all positions in the portfolio.}
+
+The function \fctn{calcPortfSummary} returns all of the columns in an xts object.
 }
 \value{
-  ~Describe the value returned
-  If it is a LIST, use
-  \item{comp1 }{Description of 'comp1'}
-  \item{comp2 }{Description of 'comp2'}
-  ...
+  An xts time series with the calculated attribute values
 }
-\references{ ~put references to the literature/web site here ~ }
-\author{ ~~who you are~~ }
-\note{ ~~further notes~~ 
-
- ~Make other sections like Warning with \section{Warning }{....} ~
-}
-\seealso{ ~~objects to See Also as \code{\link{help}}, ~~~ }
+\author{ Peter Carl }
+\seealso{ \code{\link{getBySymbol}} }
 \examples{
-##---- Should be DIRECTLY executable !! ----
-##-- ==>  Define data, use random,
-##--	or do  help(data=index)  for the standard data sets.
-
-## The function is currently defined as
-function(Portfolio, Attribute, Date=NULL)
-{
-    symbols = names(Portfolio)
-    if(is.null(Date)) # if no date is specified, get all available dates
-        Date = time(Portfolio[[1]]$posPL)
-    else
-        Date = time(Portfolio[[1]]$posPL[Date])
-    table = xts(NULL, order.by=Date) ## Reference time index
-
-    switch(Attribute,
-        Trading.PL = {
-            table = getBySymbol(Portfolio, 'Trading.PL', Date)
-            result = as.xts(t(t(apply(table, FUN='sum', MARGIN=1))))
-            colnames(result) = 'Trading.PL'
-        },
-        Txn.Fees = {
-            table = getBySymbol(Portfolio, 'Txn.Fees', Date)
-            result = as.xts(t(t(apply(table, FUN='sum', MARGIN=1)))) ## WTF?
-            colnames(result) = 'Txn.Fees'
-        },
-        Realized.PL = {
-            table = getBySymbol(Portfolio, 'Realized.PL', Date)
-            result = as.xts(t(t(apply(table, FUN='sum', MARGIN=1)))) ## WTF?
-            colnames(result) = 'Realized.PL'
-        },
-        Unrealized.PL = {
-            table = getBySymbol(Portfolio, 'Unrealized.PL', Date)
-            result = as.xts(t(t(apply(table, FUN='sum', MARGIN=1)))) ## WTF?
-            colnames(result) = 'Unrealized.PL'
-        },
-        Net.Value = {
-            table = getBySymbol(Portfolio, 'Pos.Value', Date)
-            result = as.xts(t(t(apply(table, FUN='sum', MARGIN=1)))) ## WTF?
-            colnames(result) = 'Net.Value'
-        },
-        Gross.Value = {
-            table = getBySymbol(Portfolio, 'Pos.Value', Date)
-            result = as.xts(t(t(apply(abs(table), FUN='sum', MARGIN=1)))) ## WTF?
-            colnames(result) = 'Gross.Value'
-        },
-        Long.Value = {
-            table = getBySymbol(Portfolio, 'Pos.Value', Date)
-            table = apply(table,MARGIN=c(1,2),FUN=max,0)
-            result = as.xts(t(t(apply(table, FUN='sum', MARGIN=1)))) ## WTF?
-            colnames(result) = 'Long.Value'
-        },
-        Short.Value = {
-            table = getBySymbol(Portfolio, 'Pos.Value', Date)
-            table = apply(table,MARGIN=c(1,2),FUN=min,0)
-            result = as.xts(t(t(apply(table, FUN='sum', MARGIN=1)))) ## WTF?
-            colnames(result) = 'Short.Value'
-        }
-    )
-    return(result)
-  }
 }
 % Add one or more standard keywords, see file 'KEYWORDS' in the
 % R documentation directory.
-\keyword{ ~kwd1 }
-\keyword{ ~kwd2 }% __ONLY ONE__ keyword per line
+\keyword{ utilities }
+\keyword{ manip }

Modified: pkg/man/calcTxnValue.Rd
===================================================================
--- pkg/man/calcTxnValue.Rd	2008-12-23 02:55:47 UTC (rev 31)
+++ pkg/man/calcTxnValue.Rd	2008-12-23 02:58:50 UTC (rev 32)
@@ -29,5 +29,5 @@
 }
 % Add one or more standard keywords, see file 'KEYWORDS' in the
 % R documentation directory.
-\keyword{ ~kwd1 }
-\keyword{ ~kwd2 }% __ONLY ONE__ keyword per line
+\keyword{ utilities }
+\keyword{ manip }

Modified: pkg/man/getByPortfolio.Rd
===================================================================
--- pkg/man/getByPortfolio.Rd	2008-12-23 02:55:47 UTC (rev 31)
+++ pkg/man/getByPortfolio.Rd	2008-12-23 02:58:50 UTC (rev 32)
@@ -1,73 +1,28 @@
 \name{getByPortfolio}
 \alias{getByPortfolio}
-%- Also NEED an '\alias' for EACH other topic documented here.
-\title{ ~~function to do ... ~~ }
+\title{ Create a portfolio-by-time table of a portfolio summary attribute }
 \description{
-  ~~ A concise (1-5 lines) description of what the function does. ~~
+    Retrieves calculated attributes for each portfolio in the account from the portfolio summary table.  Assembles into a portfolio-by-time table useful for graphing or calculations.
 }
 \usage{
 getByPortfolio(Account, Attribute, Date = NULL)
 }
-%- maybe also 'usage' for other objects documented here.
 \arguments{
-  \item{Account}{ ~~Describe \code{Account} here~~ }
-  \item{Attribute}{ ~~Describe \code{Attribute} here~~ }
-  \item{Date}{ ~~Describe \code{Date} here~~ }
+  \item{Account}{ An Account object containing Portfolio summaries }
+  \item{Attribute}{ Column name to be assembled for each symbol, any of: 'Long.Value', 'Short.Value', 'Net.Value', 'Gross.Value', 'Txn.Fees', 'Realized.PL', 'Unrealized.PL', or 'Trading.PL' }
+  \item{Date}{ \pkg{xts} date range to return.  If no date is specified, the function returns all available dates }
 }
 \details{
-  ~~ If necessary, more details than the description above ~~
+    Retrieves and formats values calculated by the function \code{\link{updateAcct}}.  The resulting xts object is formatted with the portfolio name as the columnname. 
 }
 \value{
-  ~Describe the value returned
-  If it is a LIST, use
-  \item{comp1 }{Description of 'comp1'}
-  \item{comp2 }{Description of 'comp2'}
-  ...
+  An xts time series object containing the requested value for each portfolio in columns. 
 }
-\references{ ~put references to the literature/web site here ~ }
-\author{ ~~who you are~~ }
-\note{ ~~further notes~~ 
-
- ~Make other sections like Warning with \section{Warning }{....} ~
-}
-\seealso{ ~~objects to See Also as \code{\link{help}}, ~~~ }
+\author{ Peter Carl }
+\seealso{ \code{\link{initAcct}}, \code{\link{updateAcct}} }
 \examples{
-##---- Should be DIRECTLY executable !! ----
-##-- ==>  Define data, use random,
-##--	or do  help(data=index)  for the standard data sets.
-
-## The function is currently defined as
-function(Account, Attribute, Date=NULL)
-{ # @author Peter Carl
-
-    # DESCRIPTION:
-    # Retrieves calculated attributes for each portfolio in the account
-    # from the portfolio summary table.  Assembles into a portfolio-by-time table 
-
-    # Inputs
-    # Account: an Account object containing Portfolio summaries
-    # Attribute: column name to be assembled for each symbol, any of:
-    # 'Long.Value', 'Short.Value', 'Net.Value', 'Gross.Value', 'Txn.Fees',
-    # 'Realized.PL', 'Unrealized.PL', or 'Trading.PL'
-
-    # Outputs
-    # regular xts object of values by portfolio
-
-    # FUNCTION
-    if(is.null(Date)) # if no date is specified, get all available dates
-        Date = time(Account[[2]])
-    else
-        Date = time(Account[[2]][Date])
-    table = xts(NULL, order.by=Date) 
-      ## Need a reference time index
-    portfolios=names(Account)[-1]
-    for (i in 1:length(portfolios)) 
-        table = merge(table, Account[[i+1]][Date,Attribute,drop=FALSE])
-    colnames(table) = portfolios
-    return(table)
-  }
 }
 % Add one or more standard keywords, see file 'KEYWORDS' in the
 % R documentation directory.
-\keyword{ ~kwd1 }
-\keyword{ ~kwd2 }% __ONLY ONE__ keyword per line
+\keyword{ utilities }
+\keyword{ manip }

Modified: pkg/man/getBySymbol.Rd
===================================================================
--- pkg/man/getBySymbol.Rd	2008-12-23 02:55:47 UTC (rev 31)
+++ pkg/man/getBySymbol.Rd	2008-12-23 02:58:50 UTC (rev 32)
@@ -1,78 +1,29 @@
 \name{getBySymbol}
 \alias{getBySymbol}
-%- Also NEED an '\alias' for EACH other topic documented here.
-\title{ ~~function to do ... ~~ }
+\title{ Create a symbol-by-time table of a portfolio attribute }
 \description{
-  ~~ A concise (1-5 lines) description of what the function does. ~~
+Retrieves calculated attributes for each position in the portfolio from the \kbd{posPL} table.  Assembles the results into a symbol-by-time table useful for graphing or calculations.
 }
 \usage{
 getBySymbol(Portfolio, Attribute, Date = NULL)
 }
-%- maybe also 'usage' for other objects documented here.
 \arguments{
-  \item{Portfolio}{ ~~Describe \code{Portfolio} here~~ }
-  \item{Attribute}{ ~~Describe \code{Attribute} here~~ }
-  \item{Date}{ ~~Describe \code{Date} here~~ }
+  \item{Portfolio}{ A Portfolio object containing transactions }
+  \item{Attribute}{ Column name to be assembled for each symbol in the Portfolio, any of: 'Pos.Qty', 'Pos.Value', 'Txn.Value', 'Realized.PL', 'Unrealized.PL', or 'Trading.PL' }
+  \item{Date}{ \package{xts} date range to return.  If no date is specified, the function returns all available dates }
 }
 \details{
-  ~~ If necessary, more details than the description above ~~
+    Retrieves and formats values calculated by the function \code{\link{updatePosPL}}.  The resulting xts object is formatted with the symbol as the columnname. 
 }
 \value{
-  ~Describe the value returned
-  If it is a LIST, use
-  \item{comp1 }{Description of 'comp1'}
-  \item{comp2 }{Description of 'comp2'}
-  ...
+  An xts time series object containing the requested value for  each symbol in columns. 
 }
-\references{ ~put references to the literature/web site here ~ }
-\author{ ~~who you are~~ }
-\note{ ~~further notes~~ 
+\author{ Peter Carl }
 
- ~Make other sections like Warning with \section{Warning }{....} ~
-}
-\seealso{ ~~objects to See Also as \code{\link{help}}, ~~~ }
+\seealso{ \code{\link{initPortf}}, \code{\link{updatePosPL}} }
 \examples{
-##---- Should be DIRECTLY executable !! ----
-##-- ==>  Define data, use random,
-##--	or do  help(data=index)  for the standard data sets.
-
-## The function is currently defined as
-function(Portfolio, Attribute, Date=NULL)
-{ # @author Peter Carl
-
-    # DESCRIPTION:
-    # Retrieves calculated attributes for each position in the portfolio
-    # from the posPL table.  Assembles into a symbol-by-time table useful
-    # for graphing or calculations
-
-    # Inputs
-    # Portfolio: a portfolio object containing transactions
-    # Item: column name to be assembled for each symbol, any of:
-    #   'Pos.Qty', 'Pos.Value', 'Txn.Value', 'Realized.PL', 'Unrealized.PL',
-    #    or 'Trading.PL'
-
-    # Outputs
-    # regular xts object of values by symbol
-
-    # FUNCTION
-    if(is.null(Date)) # if no date is specified, get all available dates
-        Date = time(Portfolio[[1]]$posPL)
-    else
-        Date = time(Portfolio[[1]]$posPL[Date])
-    table = xts(NULL, order.by=Date) 
-      ## Need a reference time index
-    symbols=names(Portfolio)
-    for (i in 1:length(symbols)) 
-        table = merge(table, Portfolio[[i]]$posPL[Date,Attribute,drop=FALSE])
-    colnames(table) = symbols
-    return(table)
-
-## TODO: append summary information in last columns based on Attribute requested
-# e.g., 'Pos.Value' would append Net.Value, Gross.Value, Long.Value, Short.Value
-# using calcPortfAttr(p,'Net.Value')
-  }
 }
 % Add one or more standard keywords, see file 'KEYWORDS' in the
 % R documentation directory.
-\keyword{ ~kwd1 }
-\keyword{ ~kwd2 }% __ONLY ONE__ keyword per line
+\keyword{ utilities }
+\keyword{ manip }

Modified: pkg/man/getTxn.Rd
===================================================================
--- pkg/man/getTxn.Rd	2008-12-23 02:55:47 UTC (rev 31)
+++ pkg/man/getTxn.Rd	2008-12-23 02:58:50 UTC (rev 32)
@@ -52,5 +52,5 @@
 }
 % Add one or more standard keywords, see file 'KEYWORDS' in the
 % R documentation directory.
-\keyword{ ~kwd1 }
-\keyword{ ~kwd2 }% __ONLY ONE__ keyword per line
+\keyword{ utilities }
+\keyword{ manip }

Modified: pkg/man/initAcct.Rd
===================================================================
--- pkg/man/initAcct.Rd	2008-12-23 02:55:47 UTC (rev 31)
+++ pkg/man/initAcct.Rd	2008-12-23 02:58:50 UTC (rev 32)
@@ -28,35 +28,35 @@
 An Account object is a list of portfolios with aggregated portfolio summary information from all of the portfolios affiliated with the account.
 
 The Account object is modeled on the information contained within the CFTC's thirteen-column presentation table.  To support that presentation, the account object tracks the following items at the account level:
-  \item{Additions} {The sum of all new capital additions made at the beginning of the period into this account or initial deposits to a newly opened account. This does not include profits on existing money.}
-  \item{Withdrawals} {The total of capital withdrawals made at the beginning of the period from this account, such as a partial withdrawal for whatever reason or the total ending equity from a terminating account.}
-  \item{Txn.Fees} {The sum of brokerage commissions, exchange and other brokerage fees paid by the account during the period.}
-  \item{Realized.PL} {The sum of net realized profits or losses aggregated from the underlying portfolios.  Gross realized profits can be calculated by adding 'Txn.Fees', the brokerage commission expenses for the period.}
-  \item{Unrealized.PL} {The sum total increase or decrease in unrealized profits or losses on open positions in all of the portfolios in the account at the end of the period.}
-  \item{Int.Income} {Includes all interest earned on investible capital, usually from debt instruments such as Treasury bills.}
-  \item{Trading.PL} {Net realized profit or loss plus interest income plus change in unrealized profit or loss across all portfolios in the account. }
-  \item{Advisory.Fees} {Management and incentive fees charged or accrued during the period by the advisor for services rendered.}
-  \item{Net.Performance} { Trading profit or loss minus charges made as advisory fees. }
-  \item{End.Eq} {Capital available for trading as of the end of the period, such as the end of the day or of the month. The following period's beginning equity is equal to the prior period's ending equity.  Period rate of return can be calculated from this column.}
+  \item{Additions}{The sum of all new capital additions made at the beginning of the period into this account or initial deposits to a newly opened account. This does not include profits on existing money.}
+  \item{Withdrawals}{The total of capital withdrawals made at the beginning of the period from this account, such as a partial withdrawal for whatever reason or the total ending equity from a terminating account.}
+  \item{Txn.Fees}{The sum of brokerage commissions, exchange and other brokerage fees paid by the account during the period.}
+  \item{Realized.PL}{The sum of net realized profits or losses aggregated from the underlying portfolios.  Gross realized profits can be calculated by adding 'Txn.Fees', the brokerage commission expenses for the period.}
+  \item{Unrealized.PL}{The sum total increase or decrease in unrealized profits or losses on open positions in all of the portfolios in the account at the end of the period.}
+  \item{Int.Income}{Includes all interest earned on investible capital, usually from debt instruments such as Treasury bills.}
+  \item{Trading.PL}{Net realized profit or loss plus interest income plus change in unrealized profit or loss across all portfolios in the account. }
+  \item{Advisory.Fees}{Management and incentive fees charged or accrued during the period by the advisor for services rendered.}
+  \item{Net.Performance}{ Trading profit or loss minus charges made as advisory fees. }
+  \item{End.Eq}{Capital available for trading as of the end of the period, such as the end of the day or of the month. The following period's beginning equity is equal to the prior period's ending equity.  Period rate of return can be calculated from this column.}
 
 For each portfolio, the account object tracks calculated portfolio information.  That information is calculated by the function \code{\link{calcPortfSummary}}.  For each portfolio held in the account, a slot named for the portfolio contains the following columns, held in a regular xts time series:
-
-  \item{Long.Value} { The sum of the notional value of all positions held long in the portfolio.}
-  \item{Short.Value} {The sum of the notional value of all positions held short in the portfolio.} 
-  \item{Net.Value} {The sum of the notional long and notional short value of the portfolio.}
-  \item{Gross.Value} {The sum of the notional long and absolute value of the notional short value of the portfolio.}
-  \item{Txn.Fees} {The sum of brokerage commissions, exchange and other brokerage fees paid by the portfolio during the period.}
-  \item{Realized.PL} {The sum of net realized profits or losses aggregated from the underlying positions in the portfolio.  Gross realized profits can be calculated by adding 'Txn.Fees', the brokerage commission expenses for the period.}
-  \item{Unrealized.PL} {The sum total increase or decrease in unrealized profits or losses on open positions in the portfolio at the end of the period.}
-  \item{Trading.PL} {Net realized profit or loss plus interest income plus change in unrealized profit or loss across all positions in the portfolio.}
-  
+\itemize{
+  \item{Long.Value}{ The sum of the notional value of all positions held long in the portfolio.}
+  \item{Short.Value}{The sum of the notional value of all positions held short in the portfolio.} 
+  \item{Net.Value}{The sum of the notional long and notional short value of the portfolio.}
+  \item{Gross.Value}{The sum of the notional long and absolute value of the notional short value of the portfolio.}
+  \item{Txn.Fees}{The sum of brokerage commissions, exchange and other brokerage fees paid by the portfolio during the period.}
+  \item{Realized.PL}{The sum of net realized profits or losses aggregated from the underlying positions in the portfolio.  Gross realized profits can be calculated by adding 'Txn.Fees', the brokerage commission expenses for the period.}
+  \item{Unrealized.PL}{The sum total increase or decrease in unrealized profits or losses on open positions in the portfolio at the end of the period.}
+  \item{Trading.PL}{Net realized profit or loss plus interest income plus change in unrealized profit or loss across all positions in the portfolio.}
+  }
 TODO: Eventually, an Account object should track cash transactions much like a Portfolio object.
 }
-\seealso{ \code{\link{table.13col}}, \code{\link{calcPortfSummary}}, \code{\link{initPortf}} }
+\seealso{ \code{\link{calcPortfSummary}}, \code{\link{initPortf}} }
 \examples{
 
 }
 % Add one or more standard keywords, see file 'KEYWORDS' in the
 % R documentation directory.
-\keyword{ ~kwd1 }
-\keyword{ ~kwd2 }% __ONLY ONE__ keyword per line
+\keyword{ utilities }
+\keyword{ manip }
\ No newline at end of file

Modified: pkg/man/updateAcct.Rd
===================================================================
--- pkg/man/updateAcct.Rd	2008-12-23 02:55:47 UTC (rev 31)
+++ pkg/man/updateAcct.Rd	2008-12-23 02:58:50 UTC (rev 32)
@@ -1,34 +1,43 @@
 \name{updateAcct}
 \alias{updateAcct}
 \alias{updateEndEq}
+\alias{calcEndEq}
 
-\title{ calculate equity account attributes }
+\title{ Update equity account attributes and ending account value from underlying portfolios }
 \description{
-  Calculates the equity account information from the underlying portfolio profits and losses.
+  Calculates the equity account information and component portfolio attributes from the underlying portfolio profits and losses.
 }
 \usage{
 updateAcct(Account, Dates)
 updateEndEq(Account, Dates)
+calcEndEq(Account, Date)
 }
 \arguments{
-  \item{Account}{ The account object to update. }
+  \item{Account}{ The Account object to update. }
   \item{Dates}{ The ISO 8601 dates to update.  If no date is specified, the function uses all available dates from the first portfolio in the account. }
+  \item{Date}{ The ISO 8601 date to update.  No default. }
 }
 \details{
-For each date, the updateAcct function calculates realized and unrealized P&L based on the performance of each underlying Portfolio.  To do that, it first appends the portfolio summary data to the portfolio slot, then aggregates the portfolio information into the TOTAL slot.  The updateAcct function does not calculate the final capital amount (ending equity) for the period -- only the profit or loss for the period.
+For each date, the \code{updateAcct} function calculates realized and unrealized P&L based on the performance of each underlying Portfolio, using \code{\link{calcPortfSummary}} (which in turn uses \code{\link{calcPortfAttr}}).  To do that, it first appends the Portfolio summary data to the \kbd{[portfolio_name]} slot, then aggregates the portfolio information into the \kbd{TOTAL} slot.  The \code{updateAcct} function does not calculate the final capital amount (ending equity) for the period -- only the Account trading profit or loss for the period.
 
-The updateEndEq function calculates the final capital amount (ending equity) for the period.
+The \code{updateEndEq} function calculates the final capital amount (ending equity) for the period.  It's a wrapper for \code{calcEndEq} that handles a list of dates.  The \code{calcEndEq} function calculates both \kbd{End.Eq} and \kbd{Net.Performance}.
 
 These functions are separate so that other updates may be made to the Account object before the final equity is calculated, for example, additions and withdrawals, management and incentive fees, interest income, etc.  As a result, these will likely be run sequentially with intermediate functions for adding other cash transactions.
+
+The functions \code{updateEndEq} and \code{calcEndEq} require that \code{updateAcct} has been run and any additional functions have alread appended information into that table (e.g., additions or withdrawals, fees, interest, etc.).  
+
 }
 \value{
-  Returns the Account object specified in the inputs with modifications.
+    \item{\code{updateAcct}}{returns the Account object specified in the inputs with modifications}
+    \item{\code{updateEndEq}}{returns the Account object specified in the inputs with modifications}
+    \item{\code{calcEndEq}}{returns the Account object specified in the inputs with modifications}
+
 }
 \author{ Peter Carl }
 \note{  
 To see the names of the underlying portfolios, use 'names(Account)[-1]'.  Each of those named slots is used to store calculated portfolio information from the portfolio objects.
 
-The first slot of the account object, labeled 'TOTAL', is used to store aggregated account information.  See \code{\link{initAccount}} for more information.
+The first slot of the account object, labeled 'TOTAL', is used to store aggregated account information.  See \code{\link{initAcct}} for more information.
 
 }
 \seealso{ \code{\link{initAcct}}, \code{\link{initPortf}}, \code{\link{updatePortf}} }
@@ -37,5 +46,5 @@
 }
 % Add one or more standard keywords, see file 'KEYWORDS' in the
 % R documentation directory.
-\keyword{ ~kwd1 }
-\keyword{ ~kwd2 }% __ONLY ONE__ keyword per line
+\keyword{ utilities }
+\keyword{ manip }

Modified: pkg/man/updatePosPL.Rd
===================================================================
--- pkg/man/updatePosPL.Rd	2008-12-23 02:55:47 UTC (rev 31)
+++ pkg/man/updatePosPL.Rd	2008-12-23 02:58:50 UTC (rev 32)
@@ -17,14 +17,13 @@
   \item{Prices}{ Close prices in an xts object with a columnname containing a substring "Close". }
 }
 \details{
-  The 'updatePortf' function goes through each symbol in a portfolio and calculates the PL for each day prices are available.
+  The \code{updatePortf} function goes through each symbol in a portfolio and calculates the PL for each day prices are available.
 
-  StartDate and EndDate must appear in the price stream.
+  \kbd{StartDate} and \kbd{EndDate} must appear in the price stream.
 }
 \value{
   Returns the revised portfolio object specified in the input.
 }
-\references{ ~put references to the literature/web site here ~ }
 \author{ Peter Carl }
 \note{ 
 }
@@ -33,5 +32,5 @@
 }
 % Add one or more standard keywords, see file 'KEYWORDS' in the
 % R documentation directory.
-\keyword{ ~kwd1 }
-\keyword{ ~kwd2 }% __ONLY ONE__ keyword per line
+\keyword{ utilities }
+\keyword{ manip }



More information about the Blotter-commits mailing list