[Blotter-commits] r31 - pkg/man

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Tue Dec 23 03:55:47 CET 2008


Author: peter_carl
Date: 2008-12-23 03:55:47 +0100 (Tue, 23 Dec 2008)
New Revision: 31

Removed:
   pkg/man/calcPortfSummary.Rd
Modified:
   pkg/man/calcAcctAttr.Rd
Log:
- removed autogen Rd files in favor of consolidated documentation


Modified: pkg/man/calcAcctAttr.Rd
===================================================================
--- pkg/man/calcAcctAttr.Rd	2008-12-23 02:54:45 UTC (rev 30)
+++ pkg/man/calcAcctAttr.Rd	2008-12-23 02:55:47 UTC (rev 31)
@@ -1,67 +1,37 @@
 \name{calcAcctAttr}
 \alias{calcAcctAttr}
-%- Also NEED an '\alias' for EACH other topic documented here.
-\title{ ~~function to do ... ~~ }
+\title{ Calculate account attributes }
 \description{
-  ~~ A concise (1-5 lines) description of what the function does. ~~
+  Calculates the net attributes of the portfolios contained within an account
 }
 \usage{
 calcAcctAttr(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}{ The value to be aggregated from each portfolio, any of: 'Long.Value', 'Short.Value', 'Net.Value', 'Gross.Value', 'Txn.Fees', 'Realized.PL', 'Unrealized.PL', or 'Trading.PL' }
+  \item{Date}{ Date range to return.  If NULL (default), the function returns all available dates }
 }
 \details{
-  ~~ If necessary, more details than the description above ~~
+The attributes for the account are defined as:
+    \item{Long.Value}{ The aggregated value of the positions held long in each portfolio.} 
+    \item{Short.Value}{ The aggregated value of the positions held short in each portfolio.}
+    \item{Net.Value}{ The net value of the positions held in each portfolio, calculated as long value less short value.}
+    \item{Gross.Value}{ The gross value of the positions held in each portfolio, calculated as longs plus absolute value of shorts.}
+    \item{Txn.Fees}{ The aggregated value of transaction fees for each portfolio.}
+    \item{Realized.PL}{ The aggregated value of the realized profit and loss for each portfolio.}
+    \item{Unrealized.PL}{ The aggregated value of the unrealized profit and loss for each portfolio.}
+    \item{Trading.PL}{ The sum of the realized and unrealized profit and loss for each portfolio.}
 }
 \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{getByPortf}} }
 \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
-    # 
-
-    # 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'
-
-    portfolios = names(Account)[-1]
-    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) ## Reference time index
-    table = getByPortfolio(Account, Attribute, Date)
-    result = as.xts(t(t(apply(table, FUN='sum', MARGIN=1))))
-    colnames(result) = Attribute
-    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 }

Deleted: pkg/man/calcPortfSummary.Rd
===================================================================
--- pkg/man/calcPortfSummary.Rd	2008-12-23 02:54:45 UTC (rev 30)
+++ pkg/man/calcPortfSummary.Rd	2008-12-23 02:55:47 UTC (rev 31)
@@ -1,69 +0,0 @@
-\name{calcPortfSummary}
-\alias{calcPortfSummary}
-%- Also NEED an '\alias' for EACH other topic documented here.
-\title{ ~~function to do ... ~~ }
-\description{
-  ~~ A concise (1-5 lines) description of what the function does. ~~
-}
-\usage{
-calcPortfSummary(Portfolio, Date = NULL)
-}
-%- maybe also 'usage' for other objects documented here.
-\arguments{
-  \item{Portfolio}{ ~~Describe \code{Portfolio} here~~ }
-  \item{Date}{ ~~Describe \code{Date} here~~ }
-}
-\details{
-  ~~ If necessary, more details than the description above ~~
-}
-\value{
-  ~Describe the value returned
-  If it is a LIST, use
-  \item{comp1 }{Description of 'comp1'}
-  \item{comp2 }{Description of 'comp2'}
-  ...
-}
-\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}}, ~~~ }
-\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, Date=NULL)
-{ # @ author Peter Carl
-
-    # DESCRIPTION
-    # Create portfolio summary with the following columns
-    # Long.Value, Short.Value, Net.Value, Trading.PL
-
-    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])
-    TradingPL = calcPortfAttr(Portfolio, 'Trading.PL', Date)
-    RealizedPL = calcPortfAttr(Portfolio, 'Realized.PL', Date)
-    UnrealizedPL = calcPortfAttr(Portfolio, 'Unrealized.PL', Date)
-    # UnrealizedPL = TradingPL - RealizedPL
-    TxnFees = calcPortfAttr(Portfolio, 'Txn.Fees', Date)
-    NetValue = calcPortfAttr(Portfolio, 'Net.Value', Date)
-    GrossValue = calcPortfAttr(Portfolio, 'Gross.Value', Date)
-    LongValue = calcPortfAttr(Portfolio, 'Long.Value', Date)
-    ShortValue = calcPortfAttr(Portfolio, 'Short.Value', Date)
-
-    summary=merge(LongValue, ShortValue, NetValue, GrossValue, TxnFees, RealizedPL, UnrealizedPL, TradingPL)
-#     colnames(summary)=c('Long.Value', 'Short.Value', 'Net.Value', 'Gross.Value', 'Txn.Fees','Realized.PL', 'Unrealized.PL', 'Trading.PL')
-# Needed?
-    return(summary)
-  }
-}
-% Add one or more standard keywords, see file 'KEYWORDS' in the
-% R documentation directory.
-\keyword{ ~kwd1 }
-\keyword{ ~kwd2 }% __ONLY ONE__ keyword per line



More information about the Blotter-commits mailing list