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

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Mon Oct 27 22:06:03 CET 2014


Author: braverock
Date: 2014-10-27 22:06:03 +0100 (Mon, 27 Oct 2014)
New Revision: 1643

Modified:
   pkg/blotter/DESCRIPTION
   pkg/blotter/NAMESPACE
   pkg/blotter/R/addTxn.R
   pkg/blotter/man/AcctReturns.Rd
   pkg/blotter/man/PortfReturns.Rd
   pkg/blotter/man/addAcctTxn.Rd
   pkg/blotter/man/addDiv.Rd
   pkg/blotter/man/addPortfInstr.Rd
   pkg/blotter/man/addTxn.Rd
   pkg/blotter/man/calcPortfWgt.Rd
   pkg/blotter/man/calcPosAvgCost.Rd
   pkg/blotter/man/calcTxnAvgCost.Rd
   pkg/blotter/man/calcTxnValue.Rd
   pkg/blotter/man/chart.ME.Rd
   pkg/blotter/man/chart.Posn.Rd
   pkg/blotter/man/chart.Reconcile.Rd
   pkg/blotter/man/chart.Spread.Rd
   pkg/blotter/man/dailyTxnPL.Rd
   pkg/blotter/man/extractTxns.Rd
   pkg/blotter/man/getAccount.Rd
   pkg/blotter/man/getByPortf.Rd
   pkg/blotter/man/getBySymbol.Rd
   pkg/blotter/man/getEndEq.Rd
   pkg/blotter/man/getPortfAcct.Rd
   pkg/blotter/man/getPortfolio.Rd
   pkg/blotter/man/getPos.Rd
   pkg/blotter/man/getPosAvgCost.Rd
   pkg/blotter/man/getPosQty.Rd
   pkg/blotter/man/getTxns.Rd
   pkg/blotter/man/initAcct.Rd
   pkg/blotter/man/initPortf.Rd
   pkg/blotter/man/initPosPL.Rd
   pkg/blotter/man/initSummary.Rd
   pkg/blotter/man/initTxn.Rd
   pkg/blotter/man/is.account.Rd
   pkg/blotter/man/is.portfolio.Rd
   pkg/blotter/man/pennyPerShare.Rd
   pkg/blotter/man/perTradeStats.Rd
   pkg/blotter/man/put.account.Rd
   pkg/blotter/man/put.portfolio.Rd
   pkg/blotter/man/tradeQuantiles.Rd
   pkg/blotter/man/tradeStats.Rd
   pkg/blotter/man/updateAcct.Rd
   pkg/blotter/man/updateEndEq.Rd
   pkg/blotter/man/updatePortf.Rd
   pkg/blotter/man/updatePosPL.Rd
Log:
- add allowRebates argument to addTxn, default FALSE and stop with error
- update roxygen docs
- bump version

Modified: pkg/blotter/DESCRIPTION
===================================================================
--- pkg/blotter/DESCRIPTION	2014-10-26 17:34:20 UTC (rev 1642)
+++ pkg/blotter/DESCRIPTION	2014-10-27 21:06:03 UTC (rev 1643)
@@ -2,7 +2,7 @@
 Type: Package
 Title: Tools for transaction-oriented trading systems
     development.
-Version: 0.9.1637
+Version: 0.9.1643
 Date: $Date$
 Author: Peter Carl, Brian G. Peterson
 Maintainer: Brian G. Peterson <brian at braverock.com>

Modified: pkg/blotter/NAMESPACE
===================================================================
--- pkg/blotter/NAMESPACE	2014-10-26 17:34:20 UTC (rev 1642)
+++ pkg/blotter/NAMESPACE	2014-10-27 21:06:03 UTC (rev 1643)
@@ -1,3 +1,5 @@
+# Generated by roxygen2 (4.0.2): do not edit by hand
+
 export(.getPortfolio)
 export(AcctReturns)
 export(PortfReturns)

Modified: pkg/blotter/R/addTxn.R
===================================================================
--- pkg/blotter/R/addTxn.R	2014-10-26 17:34:20 UTC (rev 1642)
+++ pkg/blotter/R/addTxn.R	2014-10-27 21:06:03 UTC (rev 1643)
@@ -41,6 +41,7 @@
 #' @param TxnPrice  Price at which the transaction was done
 #' @param \dots Any other passthrough parameters
 #' @param TxnFees Fees associated with the transaction, e.g. commissions., See Details
+#' @param allowRebates whether to allow positive (rebate) TxnFees, default FALSE
 #' @param ConMult Contract/instrument multiplier for the Symbol if it is not defined in an instrument specification
 #' @param verbose If TRUE (default) the function prints the elements of the transaction in a line to the screen, e.g., "2007-01-08 IBM 50 @@ 77.6". Suppress using FALSE.
 #' @param eps value to add to force unique indices
@@ -54,7 +55,7 @@
 #' @author Peter Carl, Brian G. Peterson
 #' @export addTxn
 #' @export addTxns
-addTxn <- function(Portfolio, Symbol, TxnDate, TxnQty, TxnPrice, ..., TxnFees=0, ConMult=NULL, verbose=TRUE, eps=1e-06)
+addTxn <- function(Portfolio, Symbol, TxnDate, TxnQty, TxnPrice, ..., TxnFees=0, allowRebates=FALSE, ConMult=NULL, verbose=TRUE, eps=1e-06)
 { 
     pname <- Portfolio
     #If there is no table for the symbol then create a new one
@@ -100,7 +101,7 @@
     if (is.function(TxnFees)) txnfees <- TxnFees(TxnQty, TxnPrice) else txnfees<- as.numeric(TxnFees)
 
     if(is.null(txnfees) | is.na(txnfees)) txnfees = 0
-    if(txnfees>0) warning('Positive Transaction Fees should only be used in the case of broker/exchange rebates for TxnFees ',TxnFees,'. See Documentation.')
+    if(txnfees>0 && !isTRUE(allowRebates)) stop('Positive Transaction Fees should only be used in the case of broker/exchange rebates for TxnFees ',TxnFees,'. See Documentation.')
     
     # Calculate the value and average cost of the transaction
     TxnValue = .calcTxnValue(TxnQty, TxnPrice, 0, ConMult) # Gross of Fees
@@ -147,7 +148,7 @@
 
 #' @rdname addTxn
 #' @export
-addTxns<- function(Portfolio, Symbol, TxnData , verbose=FALSE, ..., ConMult=NULL, eps=1e-06)
+addTxns<- function(Portfolio, Symbol, TxnData , verbose=FALSE, ..., ConMult=NULL, allowRebates=FALSE, eps=1e-06)
 {
     pname <- Portfolio
     #If there is no table for the symbol then create a new one
@@ -184,6 +185,11 @@
     } else {
       NewTxns$Txn.Fees <- 0
     }
+  
+    if(any(NewTxns$Txn.Fees > 0) && !isTRUE(allowRebates)){
+      stop('Positive Transaction Fees should only be used in the case of broker/exchange rebates. See Documentation.')
+    }
+  
     # split transactions that would cross through zero
     Pos <- drop(cumsum(NewTxns$Txn.Qty))
     Pos <- merge(Qty=Pos, PrevQty=lag(Pos))

Modified: pkg/blotter/man/AcctReturns.Rd
===================================================================
--- pkg/blotter/man/AcctReturns.Rd	2014-10-26 17:34:20 UTC (rev 1642)
+++ pkg/blotter/man/AcctReturns.Rd	2014-10-27 21:06:03 UTC (rev 1643)
@@ -1,3 +1,4 @@
+% Generated by roxygen2 (4.0.2): do not edit by hand
 \name{AcctReturns}
 \alias{AcctReturns}
 \title{Calculate account returns}
@@ -6,64 +7,56 @@
   method = c("timeweighted", "dietz"), ...)
 }
 \arguments{
-  \item{Account}{string name of the account to generate
-  returns for}
+\item{Account}{string name of the account to generate returns for}
 
-  \item{\dots}{any other passthru parameters (like
-  \code{native} for \code{.getBySymbol}}
+\item{Dates}{xts style ISO 8601 date subset to retrieve, default NULL
+(all dates)}
 
-  \item{Dates}{xts style ISO 8601 date subset to retrieve,
-  default NULL (all dates)}
+\item{Portfolios}{concatenated string vector for portfolio names to retrieve
+returns on, default NULL (all portfolios)}
 
-  \item{Portfolios}{concatenated string vector for
-  portfolio names to retrieve returns on, default NULL (all
-  portfolios)}
+\item{method}{Used to select between time-weighted and linked modified Dietz
+returns. May be any of: \itemize{\item timeweighted \item dietz} By default
+time-weighted is selected}
 
-  \item{method}{Used to select between time-weighted and
-  linked modified Dietz returns. May be any of:
-  \itemize{\item timeweighted \item dietz} By default
-  time-weighted is selected}
+\item{\dots}{any other passthru parameters (like \code{native} for
+\code{.getBySymbol}}
 }
 \value{
 returns xts with account returns
 }
 \description{
-Similar to the \code{PortfReturns} function, but gives
-returns for the entire account and takes into account
-external cashflows. External cashflows are defined as
-contributions to or withdrawals from the account. Allows
-selecting between time-weighted returns and linked modified
-Dietz approach. If time-weighted method is selected,
-returns at time \eqn{t} are computed using:
-\deqn{r_{t}=\frac{V_{t}}{V_{t-1}+C_{t}}-1} where
-\eqn{V_{t}} - account value at time \eqn{t}, \eqn{C_{t}} -
-cashflow at time \eqn{t}. The implicit assumption made here
-is that the cash flow is available for the portfolio
-manager to invest from the beginning of the day. These
-returns then can be chain linked with geometric compounding
-(for instance using \code{Return.cumulative} function from
-the \code{PerformanceAnalytics} package) to yield
-cumulative multi-period returns:
+Similar to the \code{PortfReturns} function, but gives returns for the
+entire account and takes into account external cashflows. External cashflows
+are defined as contributions to or withdrawals from the account. Allows
+selecting between time-weighted returns and linked modified Dietz approach.
+If time-weighted method is selected, returns at time \eqn{t} are computed
+using: \deqn{r_{t}=\frac{V_{t}}{V_{t-1}+C_{t}}-1}
+where \eqn{V_{t}} - account value at time \eqn{t}, \eqn{C_{t}} - cashflow at
+time \eqn{t}. The implicit assumption made here is that the cash flow is
+available for the portfolio manager to invest from the beginning of the day.
+These returns then can be chain linked with geometric compounding (for
+instance using \code{Return.cumulative} function from the
+\code{PerformanceAnalytics} package) to yield cumulative multi-period
+returns:
 \deqn{1+r=\prod_{t=1}^{T}(1+r_{t})=\prod_{t=1}^{T}\frac{V_{t}}{V_{t-1}+C_{t}}}
-In the case if there were no cashflows, the result reduces
-to simple one-period returns. Time-weighted returns has
-also an interpretation in terms of unit value pricing. If
-Modified Dietz method is selected, monthly returns are
-computed taking into account cashflows within each month:
-\deqn{r =
-\frac{V_{t}-V_{t-1}-C}{V_{t-1}+\sum_{t}C_{t}\times W_{t}}}
+In the case if there were no cashflows, the result reduces to simple
+one-period returns. Time-weighted returns has also an interpretation in
+terms of unit value pricing.
+If Modified Dietz method is selected, monthly returns are computed taking
+into account cashflows within each month:
+\deqn{r = \frac{V_{t}-V_{t-1}-C}{V_{t-1}+\sum_{t}C_{t}\times W_{t}}}
 where \eqn{C} - total external cash flows within a month,
 \eqn{C_{t}} - external cashflow at time \eqn{t},
-\deqn{W_{t}=\frac{TD-D_{t}}{TD}} - weighting ratio to be
-applied to external cashflow on day \eqn{t}, \eqn{TD} -
-total number of days within the month, \eqn{D_{t}} - number
-of days since the beginning of the month including weekends
-and public holidays. Finally monthly Modified Dietz returns
-can also be linked geometrically.
+\deqn{W_{t}=\frac{TD-D_{t}}{TD}} - weighting ratio to be applied to external
+cashflow on day \eqn{t},
+\eqn{TD} - total number of days within the month,
+\eqn{D_{t}} - number of days since the beginning of the month including
+weekends and public holidays.
+Finally monthly Modified Dietz returns can also be linked geometrically.
 }
 \note{
-TODO handle portfolio and account in different currencies
-(not hard, just not done)
+TODO handle portfolio and account in different currencies (not hard, just not done)
 
 TODO explicitly handle portfolio weights
 
@@ -74,10 +67,9 @@
 }
 \references{
 Christopherson, Jon A., Carino, David R., Ferson, Wayne E.
-\emph{Portfolio Performance Measurement and Benchmarking}.
-McGraw-Hill. 2009. Chapter 5 \cr Bacon, C. \emph{Practical
-Portfolio Performance Measurement and Attribution}. Wiley.
-2004. Chapter 2 \cr
+\emph{Portfolio Performance Measurement and Benchmarking}. McGraw-Hill.
+2009. Chapter 5 \cr Bacon, C. \emph{Practical Portfolio Performance
+Measurement and Attribution}. Wiley. 2004. Chapter 2 \cr
 }
 \seealso{
 PortfReturns

Modified: pkg/blotter/man/PortfReturns.Rd
===================================================================
--- pkg/blotter/man/PortfReturns.Rd	2014-10-26 17:34:20 UTC (rev 1642)
+++ pkg/blotter/man/PortfReturns.Rd	2014-10-27 21:06:03 UTC (rev 1643)
@@ -1,3 +1,4 @@
+% Generated by roxygen2 (4.0.2): do not edit by hand
 \name{PortfReturns}
 \alias{PortfReturns}
 \title{Calculate portfolio instrument returns}
@@ -6,41 +7,32 @@
   Portfolios = NULL, period = c("daily", "none"))
 }
 \arguments{
-  \item{Account}{string name of the account to generate
-  returns for}
+\item{Account}{string name of the account to generate returns for}
 
-  \item{method}{for now, only 'contribution' is supported}
+\item{method}{for now, only 'contribution' is supported}
 
-  \item{\dots}{any other passthru parameters (like
-  \code{native} for \code{.getBySymbol}}
+\item{Dates}{xts style ISO 8601 date subset to retrieve, default NULL (all dates)}
 
-  \item{Dates}{xts style ISO 8601 date subset to retrieve,
-  default NULL (all dates)}
+\item{Portfolios}{concatenated string vector for portfolio names to retrieve returns on, default NULL (all portfolios)}
 
-  \item{Portfolios}{concatenated string vector for
-  portfolio names to retrieve returns on, default NULL (all
-  portfolios)}
+\item{period}{one of daily}
 
-  \item{period}{one of daily}
+\item{\dots}{any other passthru parameters (like \code{native} for \code{.getBySymbol}}
 }
 \description{
-This function (for now) calculates return on initial equity
-for each instrument in the portfolio or portfolios that
-make up an account.  These columns will be additive to
-return on capital of each portfolio, or of the entire
-account.
+This function (for now) calculates return on initial equity for each instrument
+in the portfolio or portfolios that make up an account.  These columns will be additive
+to return on capital of each portfolio, or of the entire account.
 }
 \details{
-This function exists because of R/Finance community
-requests by Mark Breman and Thomas Bolton
+This function exists because of R/Finance community requests by Mark Breman and Thomas Bolton
 }
 \note{
-TODO handle portfolio and account in different currencies
-(not hard, just not done)
+TODO handle portfolio and account in different currencies (not hard, just not done)
 
 TODO explicitly handle portfolio weights
 
-TODO provide additional methods of calculating returns
+TODO provide additional  methods of calculating returns
 
 TODO support additions and withdrawals to available capital
 }

Modified: pkg/blotter/man/addAcctTxn.Rd
===================================================================
--- pkg/blotter/man/addAcctTxn.Rd	2014-10-26 17:34:20 UTC (rev 1642)
+++ pkg/blotter/man/addAcctTxn.Rd	2014-10-27 21:06:03 UTC (rev 1643)
@@ -1,3 +1,4 @@
+% Generated by roxygen2 (4.0.2): do not edit by hand
 \name{addAcctTxn}
 \alias{addAcctTxn}
 \title{Add capital account transactions, such as capital additions and withdrawals or interest income (expense)}
@@ -6,55 +7,30 @@
   "Interest"), Amount, ..., verbose = TRUE)
 }
 \arguments{
-  \item{Account}{Account name, as string}
+\item{Account}{Account name, as string}
 
-  \item{TxnDate}{transaction date as ISO 8601, e.g.,
-  '2008-09-01' or '2010-01-05 09:54:23.12345'}
+\item{TxnDate}{transaction date as ISO 8601, e.g., '2008-09-01' or '2010-01-05 09:54:23.12345'}
 
-  \item{TxnType}{string indicating the type of account
-  transaction, only "Addition", "Withdrawal", or "Interest"
-  are currently supported}
+\item{TxnType}{string indicating the type of account transaction, only "Addition", "Withdrawal", or "Interest" are currently supported}
 
-  \item{Amount}{As of now, the currency of the transaction
-  MUST MATCH the currency of the Account.  Patches
-  welcome.}
+\item{Amount}{As of now, the currency of the transaction MUST MATCH the currency of the Account.  Patches welcome.}
 
-  \item{\dots}{any other passthrough parameters}
+\item{verbose}{If TRUE (default) the function prints the elements of the transaction in a line to the screen, e.g., "2007-01-08 Withdrawal 15,012,235". Suppress using FALSE.}
 
-  \item{verbose}{If TRUE (default) the function prints the
-  elements of the transaction in a line to the screen,
-  e.g., "2007-01-08 Withdrawal 15,012,235". Suppress using
-  FALSE.}
+\item{\dots}{any other passthrough parameters}
 }
 \description{
-For the specified Account, take in the date, amount, and
-type of transaction and append it to the correct list in
-the account object
+For the specified Account, take in the date, amount, and type of transaction and append it to the correct list in the account object
 }
 \details{
-Adds capital transactions to a rudimentary transactions
-table in the Account object.  This may be useful when
-tracking the denominator of returns when there are changes
-to the account's capital or significant interest income. In
-the Account$summary table, there are several placeholder
-columns that mimic the CFTC's 13-column report.  Columns of
-interest here are "Additions", "Withdrawals", and
-"Interest". Transactions added with this function will be
-added into the appropriate one of three slots in the
-Account object (Account$additions, Account$withdrawals, or
-Account$Interest), which contains an xts object of
-individual transactions with a date and amount.  The
-\code{\link{updateAcct}} function will read the
-transactions from each list in turn, aggregate them by the
-specified date scope, and slot them into the
-\code{Account$summary} table as it's built.
-\code{\link{updateEndEq}} should then just work.
+Adds capital transactions to a rudimentary transactions table in the Account object.  This may be useful when tracking the denominator of returns when there are changes to the account's capital or significant interest income.
+In the Account$summary table, there are several placeholder columns that mimic the CFTC's 13-column report.  Columns of interest here are "Additions", "Withdrawals", and "Interest".
+Transactions added with this function will be added into the appropriate one of three slots in the Account object (Account$additions, Account$withdrawals, or Account$Interest), which contains an xts object of individual transactions with a date and amount.  The \code{\link{updateAcct}} function will read the transactions from each list in turn, aggregate them by the specified date scope, and slot them into the \code{Account$summary} table as it's built. \code{\link{updateEndEq}} should then just work.
 }
 \author{
 Peter Carl
 }
 \seealso{
-\code{\link{initAcct}}, \code{\link{updateAcct}},
-\code{\link{updateEndEq}}
+\code{\link{initAcct}}, \code{\link{updateAcct}}, \code{\link{updateEndEq}}
 }
 

Modified: pkg/blotter/man/addDiv.Rd
===================================================================
--- pkg/blotter/man/addDiv.Rd	2014-10-26 17:34:20 UTC (rev 1642)
+++ pkg/blotter/man/addDiv.Rd	2014-10-27 21:06:03 UTC (rev 1643)
@@ -1,3 +1,4 @@
+% Generated by roxygen2 (4.0.2): do not edit by hand
 \name{addDiv}
 \alias{addDiv}
 \title{Add cash dividend transactions to a portfolio.}
@@ -6,35 +7,24 @@
   ConMult = NULL, verbose = TRUE)
 }
 \arguments{
-  \item{Portfolio}{A portfolio name that points to a
-  portfolio object structured with
-  \code{\link{initPortf}}.}
+\item{Portfolio}{A portfolio name that points to a portfolio object structured with \code{\link{initPortf}}.}
 
-  \item{Symbol}{An instrument identifier for a symbol
-  included in the portfolio, e.g., IBM.}
+\item{Symbol}{An instrument identifier for a symbol included in the portfolio, e.g., IBM.}
 
-  \item{TxnDate}{Transaction date as ISO 8601, e.g.,
-  '2008-09-01' or '2010-01-05 09:54:23.12345'.}
+\item{TxnDate}{Transaction date as ISO 8601, e.g., '2008-09-01' or '2010-01-05 09:54:23.12345'.}
 
-  \item{DivPerShare}{The amount of the cash dividend paid
-  per share or per unit quantity.}
+\item{DivPerShare}{The amount of the cash dividend paid per share or per unit quantity.}
 
-  \item{\dots}{Any other passthrough parameters.}
+\item{TxnFees}{Fees associated with the transaction, e.g. commissions. See Details.}
 
-  \item{TxnFees}{Fees associated with the transaction, e.g.
-  commissions. See Details.}
+\item{ConMult}{Contract or 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., "2007-01-08 IBM 50 @ 77.6". Suppress using FALSE.}
+\item{verbose}{If TRUE (default) the function prints the elements of the transaction in a line to the screen, e.g., "2007-01-08 IBM 50 @ 77.6". Suppress using FALSE.}
 
-  \item{ConMult}{Contract or instrument multiplier for the
-  Symbol if it is not defined in an instrument
-  specification.}
+\item{\dots}{Any other passthrough parameters.}
 }
 \description{
-Adding a cash dividend does not affect position quantity,
-like a split would.
+Adding a cash dividend does not affect position quantity, like a split would.
 }
 \note{
 # TODO add TxnTypes to $txn table

Modified: pkg/blotter/man/addPortfInstr.Rd
===================================================================
--- pkg/blotter/man/addPortfInstr.Rd	2014-10-26 17:34:20 UTC (rev 1642)
+++ pkg/blotter/man/addPortfInstr.Rd	2014-10-27 21:06:03 UTC (rev 1643)
@@ -1,3 +1,4 @@
+% Generated by roxygen2 (4.0.2): do not edit by hand
 \name{addPortfInstr}
 \alias{addPortfInstr}
 \title{add an instrument to a portfolio}
@@ -5,12 +6,11 @@
 addPortfInstr(Portfolio, symbols, ...)
 }
 \arguments{
-  \item{Portfolio}{portfolio identifier string}
+\item{Portfolio}{portfolio identifier string}
 
-  \item{symbols}{character vector of symbols to add to the
-  portfolio}
+\item{symbols}{character vector of symbols to add to the portfolio}
 
-  \item{\dots}{any other passthru parameters}
+\item{\dots}{any other passthru parameters}
 }
 \description{
 thanks to WolfGang Wu for making this function more usable

Modified: pkg/blotter/man/addTxn.Rd
===================================================================
--- pkg/blotter/man/addTxn.Rd	2014-10-26 17:34:20 UTC (rev 1642)
+++ pkg/blotter/man/addTxn.Rd	2014-10-27 21:06:03 UTC (rev 1643)
@@ -1,3 +1,4 @@
+% Generated by roxygen2 (4.0.2): do not edit by hand
 \name{addTxn}
 \alias{addTxn}
 \alias{addTxns}
@@ -4,59 +5,49 @@
 \title{Add transactions to a portfolio.}
 \usage{
 addTxn(Portfolio, Symbol, TxnDate, TxnQty, TxnPrice, ..., TxnFees = 0,
-  ConMult = NULL, verbose = TRUE, eps = 1e-06)
+  allowRebates = FALSE, ConMult = NULL, verbose = TRUE, eps = 1e-06)
 
 addTxns(Portfolio, Symbol, TxnData, verbose = FALSE, ..., ConMult = NULL,
-  eps = 1e-06)
+  allowRebates = FALSE, eps = 1e-06)
 }
 \arguments{
-  \item{Portfolio}{A portfolio name that points to a
-  portfolio object structured with \code{initPortf()}}
+\item{Portfolio}{A portfolio name that points to a portfolio object structured with \code{initPortf()}}
 
-  \item{Symbol}{An instrument identifier for a symbol
-  included in the portfolio, e.g., "IBM"}
+\item{Symbol}{An instrument identifier for a symbol included in the portfolio, e.g., "IBM"}
 
-  \item{TxnDate}{Transaction date as ISO 8601, e.g.,
-  '2008-09-01' or '2010-01-05 09:54:23.12345'}
+\item{TxnDate}{Transaction date as ISO 8601, e.g., '2008-09-01' or '2010-01-05 09:54:23.12345'}
 
-  \item{TxnQty}{Total units (such as shares or contracts)
-  transacted.  Positive values indicate a 'buy'; negative
-  values indicate a 'sell'}
+\item{TxnQty}{Total units (such as shares or contracts) transacted.  Positive values indicate a 'buy'; negative values indicate a 'sell'}
 
-  \item{TxnPrice}{Price at which the transaction was done}
+\item{TxnPrice}{Price at which the transaction was done}
 
-  \item{\dots}{Any other passthrough parameters}
+\item{TxnFees}{Fees associated with the transaction, e.g. commissions., See Details}
 
-  \item{TxnFees}{Fees associated with the transaction, e.g.
-  commissions., See Details}
+\item{allowRebates}{whether to allow positive (rebate) TxnFees, default FALSE}
 
-  \item{ConMult}{Contract/instrument multiplier for the
-  Symbol if it is not defined in an instrument
-  specification}
+\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., "2007-01-08 IBM 50 @ 77.6". Suppress using FALSE.}
+\item{verbose}{If TRUE (default) the function prints the elements of the transaction in a line to the screen, e.g., "2007-01-08 IBM 50 @ 77.6". Suppress using FALSE.}
 
-  \item{eps}{value to add to force unique indices}
+\item{eps}{value to add to force unique indices}
 
-  \item{TxnData}{An xts object containing all required txn
-  fields (for addTxns)}
+\item{TxnData}{An xts object containing all required txn fields (for addTxns)}
+
+\item{\dots}{Any other passthrough parameters}
 }
 \description{
-When a trade or adjustment is made to the Portfolio, the
-addTxn function calculates the value and average cost of
-the transaction, the change in position, the resulting
-positions average cost, and any realized profit or loss
-(net of fees) from the transaction. Then it stores the
-transaction and calculations in the Portfolio object.
+When a trade or adjustment is made to the Portfolio, the addTxn function
+calculates the value and average cost of the transaction,  the change in
+position, the resulting positions average cost, and any realized profit
+or loss (net of fees) from the transaction. Then it stores the transaction
+and calculations in the Portfolio object.
 }
 \details{
 Fees are indicated as negative values and will be
 subtracted from the transaction value. TxnFees can either
 be a fixed numeric amount, or a function (or charavcter
-name of a function) in which case the function is evaluated
-to determine the fee amount.
+name of a function) in which case the function is
+evaluated to determine the fee amount.
 
 The \code{\link{pennyPerShare}} function provides a simple
 example of a transaction cost function.
@@ -70,9 +61,9 @@
 
 This transaction splitting vastly simplifies realized P&L
 calculations elsewhere in the code. Such splitting also
-mirrors many execution platforms and brokerage requirements
-in particular asset classes where the side of a trade needs
-to be specified with the order.
+mirrors many execution platforms and brokerage
+requirements in particular asset classes where the side
+of a trade needs to be specified with the order.
 
 The \code{addTxns} function allows you to add multiple
 transactions to the portfolio, which is much faster than
@@ -81,16 +72,14 @@
 column is optional.
 }
 \note{
-The addTxn function will eventually also handle other
-transaction types, such as adjustments for corporate
-actions or expire/assign for options. See
-\code{\link{addDiv}}
+The addTxn function will eventually also handle other transaction types,
+such as adjustments for corporate actions or expire/assign for options.
+See \code{\link{addDiv}}
 }
 \author{
 Peter Carl, Brian G. Peterson
 }
 \seealso{
-\code{\link{addTxns}}, \code{\link{pennyPerShare}},
-\code{\link{initPortf}}
+\code{\link{addTxns}}, \code{\link{pennyPerShare}}, \code{\link{initPortf}}
 }
 

Modified: pkg/blotter/man/calcPortfWgt.Rd
===================================================================
--- pkg/blotter/man/calcPortfWgt.Rd	2014-10-26 17:34:20 UTC (rev 1642)
+++ pkg/blotter/man/calcPortfWgt.Rd	2014-10-27 21:06:03 UTC (rev 1643)
@@ -1,3 +1,4 @@
+% Generated by roxygen2 (4.0.2): do not edit by hand
 \name{calcPortfWgt}
 \alias{calcPortfWgt}
 \title{Calculates the portfolio weights for positions within a given portfolio.}
@@ -7,31 +8,24 @@
   Account)
 }
 \arguments{
-  \item{Portfolio}{a portfolio object structured with
-  initPortf()}
+\item{Portfolio}{a portfolio object structured with initPortf()}
 
-  \item{Symbols}{an instrument identifier for a symbol
-  included in the portfolio}
+\item{Symbols}{an instrument identifier for a symbol included in the portfolio}
 
-  \item{Dates}{dates to return the calculation over
-  formatted as xts range}
+\item{Dates}{dates to return the calculation over formatted as xts range}
 
-  \item{denominator}{string describing the deniminator, see
-  Description}
+\item{denominator}{string describing the deniminator, see Description}
 
-  \item{Account}{an Account object containing Portfolio
-  summaries}
+\item{Account}{an Account object containing Portfolio summaries}
 }
 \value{
-xts timeseries object with weights by date in rows and
-symbolname in columns
+xts timeseries object with weights by date in rows and symbolname in columns
 }
 \description{
-Portfolio weights may be calculated differently depending
-on their use. By default, this function uses denominator of
-'Gross.Value', the second most common option will likely be
-'Net.Value'. For separating long and short weights,
-'Long.Value' and 'Short.Value' may be needed as
-denominators.
+Portfolio weights may be calculated differently depending on their use.
+By default, this function uses denominator of 'Gross.Value', the second most common
+option will likely be 'Net.Value'.
+For separating long and short weights, 'Long.Value' and 'Short.Value' may be
+needed as denominators.
 }
 

Modified: pkg/blotter/man/calcPosAvgCost.Rd
===================================================================
--- pkg/blotter/man/calcPosAvgCost.Rd	2014-10-26 17:34:20 UTC (rev 1642)
+++ pkg/blotter/man/calcPosAvgCost.Rd	2014-10-27 21:06:03 UTC (rev 1643)
@@ -1,3 +1,4 @@
+% Generated by roxygen2 (4.0.2): do not edit by hand
 \name{.calcPosAvgCost}
 \alias{.calcPosAvgCost}
 \title{Calculates the average cost of a resulting position from a transaction}
@@ -5,24 +6,20 @@
 .calcPosAvgCost(PrevPosQty, PrevPosAvgCost, TxnValue, PosQty, ConMult = 1)
 }
 \arguments{
-  \item{PrevPosQty}{quantity of the previous position}
+\item{PrevPosQty}{quantity of the previous position}
 
-  \item{PrevPosAvgCost}{average position cost of the
-  previous position}
+\item{PrevPosAvgCost}{average position cost of the previous position}
 
-  \item{TxnValue}{total value of the transaction, including
-  fees}
+\item{TxnValue}{total value of the transaction, including fees}
 
-  \item{PosQty}{total units (shares) of the resulting
-  position}
+\item{PosQty}{total units (shares) of the resulting position}
 
-  \item{ConMult}{multiplier from instrument data}
+\item{ConMult}{multiplier from instrument data}
 }
 \value{
 PosAvgCost: average cost of the resulting position
 }
 \description{
-Calculates the average cost of a resulting position from a
-transaction
+Calculates the average cost of a resulting position from a transaction
 }
 

Modified: pkg/blotter/man/calcTxnAvgCost.Rd
===================================================================
--- pkg/blotter/man/calcTxnAvgCost.Rd	2014-10-26 17:34:20 UTC (rev 1642)
+++ pkg/blotter/man/calcTxnAvgCost.Rd	2014-10-27 21:06:03 UTC (rev 1643)
@@ -1,3 +1,4 @@
+% Generated by roxygen2 (4.0.2): do not edit by hand
 \name{.calcTxnAvgCost}
 \alias{.calcTxnAvgCost}
 \title{Calculates a per share or per contract cost of the transaction to match the units the price is quoted in}
@@ -5,19 +6,16 @@
 .calcTxnAvgCost(TxnValue, TxnQty, ConMult = 1)
 }
 \arguments{
-  \item{TxnValue}{total value of the transaction, including
-  fees}
+\item{TxnValue}{total value of the transaction, including fees}
 
-  \item{TxnQty}{total units (shares) of the transaction}
+\item{TxnQty}{total units (shares) of the transaction}
 
-  \item{ConMult}{multiplier from instrument data}
+\item{ConMult}{multiplier from instrument data}
 }
 \value{
-TxnAvgCost: unit normalized (per share) cost implied by the
-transaction
+TxnAvgCost: unit normalized (per share) cost implied by the transaction
 }
 \description{
-Calculates a per share or per contract cost of the
-transaction to match the units the price is quoted in
+Calculates a per share or per contract cost of the transaction to match the units the price is quoted in
 }
 

Modified: pkg/blotter/man/calcTxnValue.Rd
===================================================================
--- pkg/blotter/man/calcTxnValue.Rd	2014-10-26 17:34:20 UTC (rev 1642)
+++ pkg/blotter/man/calcTxnValue.Rd	2014-10-27 21:06:03 UTC (rev 1643)
@@ -1,3 +1,4 @@
+% Generated by roxygen2 (4.0.2): do not edit by hand
 \name{.calcTxnValue}
 \alias{.calcTxnValue}
 \title{Calculates the total value of a transaction or trade}
@@ -5,18 +6,16 @@
 .calcTxnValue(TxnQty, TxnPrice, TxnFees, ConMult = 1)
 }
 \arguments{
-  \item{TxnQty}{total units (shares) of the transaction}
+\item{TxnQty}{total units (shares) of the transaction}
 
-  \item{TxnPrice}{price at which the transaction was done}
+\item{TxnPrice}{price at which the transaction was done}
 
-  \item{TxnFees}{fees associated with the transaction, e.g.
-  commissions}
+\item{TxnFees}{fees associated with the transaction, e.g. commissions}
 
-  \item{ConMult}{multiplier from instrument data}
+\item{ConMult}{multiplier from instrument data}
 }
 \value{
-TxnValue: total dollar value of the transaction, including
-fees
+TxnValue: total dollar value of the transaction, including fees
 }
 \description{
 Calculates the total value of a transaction or trade

Modified: pkg/blotter/man/chart.ME.Rd
===================================================================
--- pkg/blotter/man/chart.ME.Rd	2014-10-26 17:34:20 UTC (rev 1642)
+++ pkg/blotter/man/chart.ME.Rd	2014-10-27 21:06:03 UTC (rev 1643)
@@ -1,3 +1,4 @@
+% Generated by roxygen2 (4.0.2): do not edit by hand
 \name{chart.ME}
 \alias{chart.ME}
 \title{Chart Maximum Adverse/Favorable Excursion}
@@ -6,39 +7,29 @@
   "percent", "tick"), ...)
 }
 \arguments{
-  \item{Portfolio}{string identifying the portfolio to
-  chart}
+\item{Portfolio}{string identifying the portfolio to chart}
 
-  \item{Symbol}{string identifying the symbol to chart. If
-  missing, the first symbol found in the \code{Portfolio}
-  portfolio will be used}
+\item{Symbol}{string identifying the symbol to chart. If missing, the first symbol found in the \code{Portfolio} portfolio will be used}
 
-  \item{type}{string specifying MAE (Adverse) or MFE
-  (Favourable) chart type}
+\item{type}{string specifying MAE (Adverse) or MFE (Favourable) chart type}
 
-  \item{scale}{string specifying 'cash', or 'percent' for
-  percentage of investment, or 'tick'}
+\item{scale}{string specifying 'cash', or 'percent' for percentage of investment, or 'tick'}
 
-  \item{\dots}{any other passthrough parameters, in
-  particular includeOpenTrades (see perTradeStats())}
+\item{\dots}{any other passthrough parameters, in particular includeOpenTrades (see perTradeStats())}
 }
 \description{
-Produces a scatterplot with one point per trade, with
-x-axis: absolute value of Drawdown (Adverse), or Run Up
-(Favourable), and y-axis: absolute value of Net Profit or
-Loss
+Produces a scatterplot with one point per trade, with x-axis: absolute
+value of Drawdown (Adverse), or Run Up (Favourable),
+and y-axis: absolute value of Net Profit or Loss
 }
 \author{
 Jan Humme
 }
 \references{
-Tomasini, E. and Jaekle, U. \emph{Trading Systems - A new
-approach to system development and portfolio optimisation}
-(ISBN 978-1-905641-79-6), section 3.5
+Tomasini, E. and Jaekle, U. \emph{Trading Systems - A new approach to system development and portfolio optimisation} (ISBN 978-1-905641-79-6), section 3.5
 }
 \seealso{
-\code{\link{perTradeStats}} for the calculations used by
-this chart, and \code{\link{tradeStats}} for a summary view
-of the performance
+\code{\link{perTradeStats}} for the calculations used by this chart,
+and \code{\link{tradeStats}} for a summary view of the performance
 }
 

Modified: pkg/blotter/man/chart.Posn.Rd
===================================================================
--- pkg/blotter/man/chart.Posn.Rd	2014-10-26 17:34:20 UTC (rev 1642)
+++ pkg/blotter/man/chart.Posn.Rd	2014-10-27 21:06:03 UTC (rev 1643)
@@ -1,3 +1,4 @@
+% Generated by roxygen2 (4.0.2): do not edit by hand
 \name{chart.Posn}
 \alias{chart.Posn}
[TRUNCATED]

To get the complete diff run:
    svnlook diff /svnroot/blotter -r 1643


More information about the Blotter-commits mailing list