[Blotter-commits] r194 - in pkg/blotter: R man

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Thu Jan 21 14:33:42 CET 2010


Author: braverock
Date: 2010-01-21 14:33:41 +0100 (Thu, 21 Jan 2010)
New Revision: 194

Modified:
   pkg/blotter/R/getTxn.R
   pkg/blotter/man/addTxn.Rd
   pkg/blotter/man/calcPortfAttr.Rd
   pkg/blotter/man/calcPortfWgt.Rd
   pkg/blotter/man/getBySymbol.Rd
   pkg/blotter/man/getTxn.Rd
Log:
- updates to documentation to bring in line with recent code changes, 
  especially passing identifiers as strings for lookup in the environment 

Modified: pkg/blotter/R/getTxn.R
===================================================================
--- pkg/blotter/R/getTxn.R	2010-01-21 00:57:00 UTC (rev 193)
+++ pkg/blotter/R/getTxn.R	2010-01-21 13:33:41 UTC (rev 194)
@@ -1,5 +1,4 @@
-`getTxn` <-
-function(Portfolio, Symbol, Date)
+getTxns <- function(Portfolio, Symbol, Date)
 { # @author Peter Carl
     pname<-Portfolio
     Portfolio<-get(paste("portfolio",pname,sep='.'),envir=.blotter)

Modified: pkg/blotter/man/addTxn.Rd
===================================================================
--- pkg/blotter/man/addTxn.Rd	2010-01-21 00:57:00 UTC (rev 193)
+++ pkg/blotter/man/addTxn.Rd	2010-01-21 13:33:41 UTC (rev 194)
@@ -1,5 +1,6 @@
 \name{addTxn}
 \alias{addTxn}
+\alias{addTxns}
 \alias{pennyPerShare}
 \title{ Add transactions to a Portfolio }
 \description{
@@ -11,13 +12,15 @@
   Then it stores the transaction and calculations in the Portfolio object.
 }
 \usage{
-addTxn(Portfolio, Symbol, TxnDate, TxnQty, TxnPrice, TxnFees = 0, verbose = TRUE)
+addTxn(Portfolio, Symbol, TxnDate, TxnQty, TxnPrice, TxnFees = 0, ConMult=NULL, verbose = TRUE)
+addTxn(Portfolio, Symbol, TxnData, verbose = TRUE, ... , ConMult=NULL)
 pennyPerShare(TxnQty, TxnPrice)
 }
 \arguments{
-  \item{Portfolio}{ a portfolio object structured with \code{\link{initPortf}} }
+  \item{Portfolio}{ the string identifier for a portoflio created by \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{TxnData}{ an xts time series of transactions containing columns 'Price', 'Quantity', and optionally 'Fees'}
   \item{TxnQty}{ total units (such as shares) transacted.  Positive values indicate a 'buy'; negative values indicate a 'sell' }
   \item{TxnPrice}{ market clearing price at which the transaction was done }
   \item{TxnFees}{ fees associated with the transaction,
@@ -26,6 +29,7 @@
     also provide a function of two argument quantity and price which
     permits user-defined transaction costs, possibly as function of
     transaction volume and price.}
+  \item{ConMult}{ contract/instrument multiplier for the Symbol if it is not defined in an instrument specification }
   \item{verbose}{ if TRUE (default) the function prints the elements of the transaction in a line to the screen, e.g., "IBM 2007-01-08 50 @ 77.6". Suppress using FALSE. }
 }
 \details{

Modified: pkg/blotter/man/calcPortfAttr.Rd
===================================================================
--- pkg/blotter/man/calcPortfAttr.Rd	2010-01-21 00:57:00 UTC (rev 193)
+++ pkg/blotter/man/calcPortfAttr.Rd	2010-01-21 13:33:41 UTC (rev 194)
@@ -10,7 +10,7 @@
 calcPortfSummary(Portfolio, Date = NULL)
 }
 \arguments{
-  \item{Portfolio}{ The Portfolio object for which to calculate the attribute. }
+  \item{Portfolio}{ a string with the identifier of the portfolio for which to calculate the attribute. }
   \item{Attribute}{ The attribute of the Portfolio object to calculate. See detail below.}
   \item{Symbols}{ Specify symbols to return. Default is NULL which returns all symbols.}
   \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 }

Modified: pkg/blotter/man/calcPortfWgt.Rd
===================================================================
--- pkg/blotter/man/calcPortfWgt.Rd	2010-01-21 00:57:00 UTC (rev 193)
+++ pkg/blotter/man/calcPortfWgt.Rd	2010-01-21 13:33:41 UTC (rev 194)
@@ -9,7 +9,7 @@
 }
 %- maybe also 'usage' for other objects documented here.
 \arguments{
-  \item{Portfolio}{ The Portfolio object for which to calculate the weights. }
+  \item{Portfolio}{ a string with the identifier of the portfolio for which to calculate the weights. }
   \item{Symbols}{ A subset of symbols to calculate.  Default is NULL, for which it returns weights for all symbols. }
   \item{Dates}{ The ISO 8601 date to calculate the attribute for.  If no date is specified (NULL by default), the function calculates for all available dates }
   \item{denominator}{ the aggregate measure of the portfolio to use as the denominator }

Modified: pkg/blotter/man/getBySymbol.Rd
===================================================================
--- pkg/blotter/man/getBySymbol.Rd	2010-01-21 00:57:00 UTC (rev 193)
+++ pkg/blotter/man/getBySymbol.Rd	2010-01-21 13:33:41 UTC (rev 194)
@@ -8,7 +8,7 @@
 getBySymbol(Portfolio, Attribute, Date = NULL, Symbols = NULL)
 }
 \arguments{
-  \item{Portfolio}{ A Portfolio object containing transactions }
+  \item{Portfolio}{ a string with the identifier of the portfolio }
   \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}{ \pkg{xts} date range to return.  If no date is specified, the function returns all available dates }
   \item{Symbols}{ If specified, this vector of names provides the

Modified: pkg/blotter/man/getTxn.Rd
===================================================================
--- pkg/blotter/man/getTxn.Rd	2010-01-21 00:57:00 UTC (rev 193)
+++ pkg/blotter/man/getTxn.Rd	2010-01-21 13:33:41 UTC (rev 194)
@@ -1,5 +1,5 @@
-\name{getTxn}
-\alias{getTxn}
+\name{getTxns}
+\alias{getTxns}
 \alias{getTxnFees}
 \alias{getTxnValue}
 \alias{getRealizedPL}
@@ -12,7 +12,7 @@
     These functions find and return the attribute value for the symbol and date in a specified portfolio.
 }
 \usage{
-    getTxn(Portfolio, Symbol, Date)
+    getTxns(Portfolio, Symbol, Date)
     getTxnFees(Portfolio, Symbol, Date)
     getTxnValue(Portfolio, Symbol, Date)
     getRealizedPL(Portfolio, Symbol, Date)
@@ -22,7 +22,7 @@
 }
 
 \arguments{
-    \item{Portfolio}{ a portfolio object containing transactions }
+    \item{Portfolio}{ a string with the identifier of the portfolio }
     \item{Symbol}{ an instrument identifier for a symbol included in the portfolio }
     \item{Date}{ timestamp as of which to have the most recent position }
 }
@@ -31,7 +31,7 @@
 }
 \value{
     The returned value for each function differs somewhat.  Note that functions use the date scoping differently, as described below.
-        \item{getTxn }{Table (irregular xts time series) of transactions made in the Symbol during the time period given, including values for 'Txn.Qty', 'Txn.Price', 'Txn.Fees', 'Txn.Value', and 'Txn.Avg.Cost'.}
+        \item{getTxns }{Table (irregular xts time series) of transactions made in the Symbol during the time period given, including values for 'Txn.Qty', 'Txn.Price', 'Txn.Fees', 'Txn.Value', and 'Txn.Avg.Cost'.}
         \item{getTxnFees }{Numeric value of the sum total of transaction fees given during the period specified}
         \item{getTxnValue }{Numeric value of the sum total of the notional transaction value given during the period specified}
         \item{getPos }{Table of the most recent position data for the Symbol relative to the time period given, including values for 'Pos.Qty','Pos.Avg.Cost'}



More information about the Blotter-commits mailing list