[Blotter-commits] r571 - in pkg/blotter: . R man
noreply at r-forge.r-project.org
noreply at r-forge.r-project.org
Sat Mar 12 19:27:32 CET 2011
Author: bodanker
Date: 2011-03-12 19:27:32 +0100 (Sat, 12 Mar 2011)
New Revision: 571
Modified:
pkg/blotter/DESCRIPTION
pkg/blotter/NAMESPACE
pkg/blotter/R/addTxn.R
pkg/blotter/R/tradeStats.R
pkg/blotter/man/addDiv.Rd
pkg/blotter/man/addTxn.Rd
pkg/blotter/man/addTxns.Rd
pkg/blotter/man/calcPortfWgt.Rd
pkg/blotter/man/chart.Reconcile.Rd
pkg/blotter/man/getPos.Rd
pkg/blotter/man/initAcct.Rd
pkg/blotter/man/initPortf.Rd
pkg/blotter/man/tradeStats.Rd
Log:
- Corrected Roxygen errors in tradeStats.R and addTxn.R
- Re-built docs
Modified: pkg/blotter/DESCRIPTION
===================================================================
--- pkg/blotter/DESCRIPTION 2011-03-11 12:09:33 UTC (rev 570)
+++ pkg/blotter/DESCRIPTION 2011-03-12 18:27:32 UTC (rev 571)
@@ -5,16 +5,24 @@
Date: $Date$
Author: Peter Carl, Brian G. Peterson
Maintainer: Brian G. Peterson <brian at braverock.com>
-Description: Transaction infrastructure for defining instruments, transactions, portfolios and accounts for trading systems and simulation.
- Provides portfolio support for multi-asset class and multi-currency portfolios. Still in heavy development.
+Description: Transaction infrastructure for defining instruments,
+ transactions, portfolios and accounts for trading systems and
+ simulation. Provides portfolio support for multi-asset class and
+ multi-currency portfolios. Still in heavy development.
License: GPL
LazyLoad: yes
-Depends: R (>= 2.11.1), xts (>= 0.7-6.17), quantmod (>= 0.3-14), FinancialInstrument
+Depends: R (>= 2.11.1), xts (>= 0.7-6.17), quantmod (>= 0.3-14),
+ FinancialInstrument
Suggests: PerformanceAnalytics, Hmisc, RUnit
Contributors: Lance Levenson, Ben McCann, Joshua Ulrich, Wolfgang Wu,
URL: https://r-forge.r-project.org/projects/blotter/
Copyright: (c) 2008-2011
-Collate: 'addPortfInstr.R' 'addTxn.R' 'calcPortfWgt.R' 'calcPosAvgCost.R' 'calcTxnAvgCost.R' 'calcTxnValue.R' 'chart.Posn.R'
- 'chart.Reconcile.R' 'chart.Spread.R' 'extractTests.R' 'getAccount.R' 'getByPortf.R' 'getBySymbol.R' 'getEndEq.R' 'getPortfAcct.R'
- 'getPortfolio.R' 'getPosAvgCost.R' 'getPosQty.R' 'getPos.R' 'getTxn.R' 'initAcct.R' 'initPortf.R' 'initPosPL.R' 'initSummary.R' 'initTxn.R'
- 'PortfReturns.R' 'tradeStats.R' 'updateAcct.R' 'updateEndEq.R' 'updatePortf.R' 'updatePosPL.R'
+Collate: 'addPortfInstr.R' 'addTxn.R' 'calcPortfWgt.R'
+ 'calcPosAvgCost.R' 'calcTxnAvgCost.R' 'calcTxnValue.R'
+ 'chart.Posn.R' 'chart.Reconcile.R' 'chart.Spread.R'
+ 'extractTests.R' 'getAccount.R' 'getByPortf.R' 'getBySymbol.R'
+ 'getEndEq.R' 'getPortfAcct.R' 'getPortfolio.R' 'getPosAvgCost.R'
+ 'getPosQty.R' 'getPos.R' 'getTxn.R' 'initAcct.R' 'initPortf.R'
+ 'initPosPL.R' 'initSummary.R' 'initTxn.R' 'PortfReturns.R'
+ 'tradeStats.R' 'updateAcct.R' 'updateEndEq.R' 'updatePortf.R'
+ 'updatePosPL.R'
Modified: pkg/blotter/NAMESPACE
===================================================================
--- pkg/blotter/NAMESPACE 2011-03-11 12:09:33 UTC (rev 570)
+++ pkg/blotter/NAMESPACE 2011-03-12 18:27:32 UTC (rev 571)
@@ -9,6 +9,7 @@
export(getAccount)
export(getEndEq)
export(getPortfolio)
+export(is.portfolio)
export(getPosQty)
export(getPos)
export(getTxns)
@@ -22,4 +23,3 @@
export(updateAcct)
export(updateEndEq)
export(updatePortf)
-export(is.portfolio)
Modified: pkg/blotter/R/addTxn.R
===================================================================
--- pkg/blotter/R/addTxn.R 2011-03-11 12:09:33 UTC (rev 570)
+++ pkg/blotter/R/addTxn.R 2011-03-12 18:27:32 UTC (rev 571)
@@ -21,7 +21,7 @@
#' @param \dots Any other passthrough parameters
#' @param TxnFees Fees associated with the transaction, e.g. commissions., See Details
#' @param ConMult Contract/instrument multiplier for the Symbol if it is not dened in an instrument specication
-#' @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 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.
#' @note
#' The addTxn function will eventually also handle other transaction types,
#' such as adjustments for corporate actions or expire/assign for options.
@@ -107,7 +107,7 @@
#' @param Symbol An instrument identifier for a symbol included in the portfolio, e.g., "IBM"
#' @param TxnData An xts object containing all required txn fields
#' @param \dots Any other passthrough parameters
-#' @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 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 ConMult Contract or instrument multiplier for the Symbol if it is not dened in an instrument specication
#' @seealso \code{\link{addTxn}}, \code{\link{initPortf}}
#' @note
@@ -183,7 +183,7 @@
#' @param DivPerShare The amount of the cash dividend paid per share or per unit quantity.
#' @param \dots Any other passthrough parameters.
#' @param TxnFees Fees associated with the transaction, e.g. commissions. See Details.
-#' @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 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 ConMult Contract or instrument multiplier for the Symbol if it is not dened in an instrument specication.
#' @export
#' @note
Modified: pkg/blotter/R/tradeStats.R
===================================================================
--- pkg/blotter/R/tradeStats.R 2011-03-11 12:09:33 UTC (rev 570)
+++ pkg/blotter/R/tradeStats.R 2011-03-12 18:27:32 UTC (rev 571)
@@ -50,7 +50,7 @@
#' Percent time in the market
#' Buy and hold return
#'
-#' Josh has suggested adding %-return based stats too
+#' Josh has suggested adding \%-return based stats too
tradeStats <- function(Portfolios, Symbols)
{
ret<-NULL
Modified: pkg/blotter/man/addDiv.Rd
===================================================================
--- pkg/blotter/man/addDiv.Rd 2011-03-11 12:09:33 UTC (rev 570)
+++ pkg/blotter/man/addDiv.Rd 2011-03-12 18:27:32 UTC (rev 571)
@@ -1,7 +1,8 @@
\name{addDiv}
\alias{addDiv}
\title{Add cash dividend transactions to a portfolio.}
-\usage{addDiv(Portfolio, Symbol, TxnDate, DivPerShare, ..., TxnFees=0, ConMult, verbose=TRUE)}
+\usage{addDiv(Portfolio, Symbol, TxnDate, DivPerShare, ..., TxnFees=0,
+ ConMult, verbose=TRUE)}
\description{Add cash dividend transactions to a portfolio.}
\details{Adding a cash dividend does not affect position quantity, like a split would.}
\note{# TODO add TxnTypes to $txn table
@@ -13,5 +14,5 @@
\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{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 \}
+\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 dened in an instrument specication.}}
Modified: pkg/blotter/man/addTxn.Rd
===================================================================
--- pkg/blotter/man/addTxn.Rd 2011-03-11 12:09:33 UTC (rev 570)
+++ pkg/blotter/man/addTxn.Rd 2011-03-12 18:27:32 UTC (rev 571)
@@ -1,7 +1,8 @@
\name{addTxn}
\alias{addTxn}
\title{Add transactions to a portfolio.}
-\usage{addTxn(Portfolio, Symbol, TxnDate, TxnQty, TxnPrice, ..., TxnFees=0, ConMult, verbose=TRUE)}
+\usage{addTxn(Portfolio, Symbol, TxnDate, TxnQty, TxnPrice, ..., TxnFees=0,
+ ConMult, verbose=TRUE)}
\description{Add transactions to a portfolio.}
\details{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
@@ -27,4 +28,4 @@
\item{\dots}{Any other passthrough parameters}
\item{TxnFees}{Fees associated with the transaction, e.g. commissions., See Details}
\item{ConMult}{Contract/instrument multiplier for the Symbol if it is not dened in an instrument specication}
-\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 \}}
+\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.}}
Modified: pkg/blotter/man/addTxns.Rd
===================================================================
--- pkg/blotter/man/addTxns.Rd 2011-03-11 12:09:33 UTC (rev 570)
+++ pkg/blotter/man/addTxns.Rd 2011-03-12 18:27:32 UTC (rev 571)
@@ -9,5 +9,5 @@
\item{Symbol}{An instrument identifier for a symbol included in the portfolio, e.g., "IBM"}
\item{TxnData}{An xts object containing all required txn fields}
\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 IBM 50 \}
+\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 dened in an instrument specication}}
Modified: pkg/blotter/man/calcPortfWgt.Rd
===================================================================
--- pkg/blotter/man/calcPortfWgt.Rd 2011-03-11 12:09:33 UTC (rev 570)
+++ pkg/blotter/man/calcPortfWgt.Rd 2011-03-12 18:27:32 UTC (rev 571)
@@ -1,7 +1,8 @@
\name{calcPortfWgt}
\alias{calcPortfWgt}
\title{Calculates the portfolio weights for positions within a given portfolio.}
-\usage{calcPortfWgt(Portfolio, Symbols, Dates, denominator=c("Gross.Value", "Net.Value", "Long.Value", "Short.Value"), Account)}
+\usage{calcPortfWgt(Portfolio, Symbols, Dates, denominator=c("Gross.Value",
+ "Net.Value", "Long.Value", "Short.Value"), Account)}
\description{Calculates the portfolio weights for positions within a given portfolio.}
\details{Portfolio weights may be calculated differently depending on their use.}
\value{xts timeseries object with weights by date in rows and symbolname in columns}
Modified: pkg/blotter/man/chart.Reconcile.Rd
===================================================================
--- pkg/blotter/man/chart.Reconcile.Rd 2011-03-11 12:09:33 UTC (rev 570)
+++ pkg/blotter/man/chart.Reconcile.Rd 2011-03-12 18:27:32 UTC (rev 571)
@@ -1,9 +1,13 @@
\name{chart.Reconcile}
\alias{chart.Reconcile}
\title{Chart trades against market data, position through time, and cumulative PPLdiff is 'cumulative', then this panel will display the cumsum of difference between the theoretical and actual portfolios.}
-\usage{chart.Reconcile(theoPort, actualPort, Symbol, Dates, ..., PLdiff=c("cumulative", "episodic"), data=c(FALSE, "View", "return"))}
+\usage{chart.Reconcile(theoPort, actualPort, Symbol, Dates, ...,
+ PLdiff=c("cumulative", "episodic"), data=c(FALSE, "View",
+ "return"))}
\description{Chart trades against market data, position through time, and cumulative P\&L}
-\details{Produces a four-panel chart of time series charts that contains prices and transactions in the top panel, the resulting position in the second, a cumulative profit-loss line chart in the third.
+\details{Produces a three or four-panel or chart of time series charts that contains prices and transactions in the top panel,
+the resulting position in the second, a cumulative profit-loss line chart in the third.
+
The theoretical trades, positions, and P&L are plotted first, in the 'light' versions of the colors, and then the actual values are overplotted in the main color.
If they agree completely, the theoretical values will not be visible. Differences will make themselves visible by misalignment of the symbols or lines.
Modified: pkg/blotter/man/getPos.Rd
===================================================================
--- pkg/blotter/man/getPos.Rd 2011-03-11 12:09:33 UTC (rev 570)
+++ pkg/blotter/man/getPos.Rd 2011-03-12 18:27:32 UTC (rev 571)
@@ -1,7 +1,8 @@
\name{getPos}
\alias{getPos}
\title{Retrieves all information about the position as of a date...}
-\usage{getPos(Portfolio, Symbol, Date, Columns=c("Pos.Qty", "Pos.Avg.Cost"), n=1)}
+\usage{getPos(Portfolio, Symbol, Date, Columns=c("Pos.Qty", "Pos.Avg.Cost"),
+ n=1)}
\description{Retrieves all information about the position as of a date}
\details{NOTE This could get much more complicated from here, particularly when it's conditional on symbol, etc.}
\value{All data elements related to position in a row of an xts object}
Modified: pkg/blotter/man/initAcct.Rd
===================================================================
--- pkg/blotter/man/initAcct.Rd 2011-03-11 12:09:33 UTC (rev 570)
+++ pkg/blotter/man/initAcct.Rd 2011-03-12 18:27:32 UTC (rev 571)
@@ -1,7 +1,8 @@
\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", ...)}
+\usage{initAcct(name="default", portfolios, initDate="1950-01-01", initEq=0,
+ currency="USD", ...)}
\description{Constructs the data container used to store calculated account values such as aggregated P&L, equity, etc.}
\details{Inputs
portfolios: a list of portfolio object names to attach to the account
Modified: pkg/blotter/man/initPortf.Rd
===================================================================
--- pkg/blotter/man/initPortf.Rd 2011-03-11 12:09:33 UTC (rev 570)
+++ pkg/blotter/man/initPortf.Rd 2011-03-12 18:27:32 UTC (rev 571)
@@ -1,7 +1,8 @@
\name{initPortf}
\alias{initPortf}
\title{Initializes a portfolio object.}
-\usage{initPortf(name="default", symbols, initPosQty=0, initDate="1950-01-01", currency="USD", ...)}
+\usage{initPortf(name="default", symbols, initPosQty=0, initDate="1950-01-01",
+ currency="USD", ...)}
\description{Initializes a portfolio object.}
\details{Constructs and initializes a portfolio object, which is used to contain transactions, positions, and aggregate level values.
Modified: pkg/blotter/man/tradeStats.Rd
===================================================================
--- pkg/blotter/man/tradeStats.Rd 2011-03-11 12:09:33 UTC (rev 570)
+++ pkg/blotter/man/tradeStats.Rd 2011-03-12 18:27:32 UTC (rev 571)
@@ -45,7 +45,7 @@
Percent time in the market
Buy and hold return
-Josh has suggested adding %-return based stats too}
+Josh has suggested adding \%-return based stats too}
\arguments{\item{Portfolios}{portfolio string}
\item{Symbols}{character vector of symbol strings, default NULL}
\item{uses}{for dailyStats, determines whether numbers are calculated from trades or equity curve}}
More information about the Blotter-commits
mailing list