[Blotter-commits] r1012 - in pkg/blotter: . man
noreply at r-forge.r-project.org
noreply at r-forge.r-project.org
Fri May 4 16:02:03 CEST 2012
Author: braverock
Date: 2012-05-04 16:02:03 +0200 (Fri, 04 May 2012)
New Revision: 1012
Modified:
pkg/blotter/DESCRIPTION
pkg/blotter/NAMESPACE
pkg/blotter/man/PortfReturns.Rd
pkg/blotter/man/addDiv.Rd
pkg/blotter/man/addTxn.Rd
pkg/blotter/man/addTxns.Rd
pkg/blotter/man/calcPortfWgt.Rd
pkg/blotter/man/calcPosAvgCost.Rd
pkg/blotter/man/chart.Posn.Rd
pkg/blotter/man/chart.Reconcile.Rd
pkg/blotter/man/chart.Spread.Rd
pkg/blotter/man/getBySymbol.Rd
pkg/blotter/man/getPos.Rd
pkg/blotter/man/initAcct.Rd
pkg/blotter/man/initPortf.Rd
pkg/blotter/man/initPosPL.Rd
pkg/blotter/man/updatePortf.Rd
pkg/blotter/man/updatePosPL.Rd
Log:
- update roxygen documentation, bump version, update NAMESPACE
Modified: pkg/blotter/DESCRIPTION
===================================================================
--- pkg/blotter/DESCRIPTION 2012-05-04 11:59:09 UTC (rev 1011)
+++ pkg/blotter/DESCRIPTION 2012-05-04 14:02:03 UTC (rev 1012)
@@ -2,7 +2,7 @@
Type: Package
Title: Tools for transaction-oriented trading systems
development.
-Version: 0.8.6
+Version: 0.8.7
Date: $Date$
Author: Peter Carl, Brian G. Peterson
Maintainer: Brian G. Peterson <brian at braverock.com>
Modified: pkg/blotter/NAMESPACE
===================================================================
--- pkg/blotter/NAMESPACE 2012-05-04 11:59:09 UTC (rev 1011)
+++ pkg/blotter/NAMESPACE 2012-05-04 14:02:03 UTC (rev 1012)
@@ -16,6 +16,7 @@
export(getTxns)
export(initAcct)
export(initPortf)
+export(is.account)
export(is.portfolio)
export(pennyPerShare)
export(PortfReturns)
Modified: pkg/blotter/man/PortfReturns.Rd
===================================================================
--- pkg/blotter/man/PortfReturns.Rd 2012-05-04 11:59:09 UTC (rev 1011)
+++ pkg/blotter/man/PortfReturns.Rd 2012-05-04 14:02:03 UTC (rev 1012)
@@ -3,7 +3,7 @@
\title{Calculate portfolio instrument returns}
\usage{
PortfReturns(Account, method = c("contribution"), ...,
- Dates = NULL, Portfolios = NULL)
+ Dates = NULL, Portfolios = NULL)
}
\arguments{
\item{Account}{string name of the account to generate
Modified: pkg/blotter/man/addDiv.Rd
===================================================================
--- pkg/blotter/man/addDiv.Rd 2012-05-04 11:59:09 UTC (rev 1011)
+++ pkg/blotter/man/addDiv.Rd 2012-05-04 14:02:03 UTC (rev 1012)
@@ -3,7 +3,7 @@
\title{Add cash dividend transactions to a portfolio.}
\usage{
addDiv(Portfolio, Symbol, TxnDate, DivPerShare, ...,
- TxnFees = 0, ConMult = NULL, verbose = TRUE)
+ TxnFees = 0, ConMult = NULL, verbose = TRUE)
}
\arguments{
\item{Portfolio}{A portfolio name that points to a
Modified: pkg/blotter/man/addTxn.Rd
===================================================================
--- pkg/blotter/man/addTxn.Rd 2012-05-04 11:59:09 UTC (rev 1011)
+++ pkg/blotter/man/addTxn.Rd 2012-05-04 14:02:03 UTC (rev 1012)
@@ -3,7 +3,8 @@
\title{Add transactions to a portfolio.}
\usage{
addTxn(Portfolio, Symbol, TxnDate, TxnQty, TxnPrice, ...,
- TxnFees = 0, ConMult = NULL, verbose = TRUE)
+ TxnFees = 0, ConMult = NULL, verbose = TRUE,
+ eps = 1e-06)
}
\arguments{
\item{Portfolio}{A portfolio name that points to a
@@ -32,6 +33,8 @@
\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}
}
\description{
When a trade or adjustment is made to the Portfolio, the
@@ -48,6 +51,14 @@
function is evaluated to determine the fee amount. The
\code{pennyPerShare} function provides a simple example
of a transaction cost function.
+
+ Transactions which would cross your position through zero
+ will be split into two transactions, one to flatten the
+ position, and another to initiate a new position on the
+ opposite side of the market. The new (split) transaction
+ will have it's timestamp inclremented by eps to preserve
+ ordering. This transaction splitting vastly simplifies
+ realized P&L calculations elsewhere in the code.
}
\note{
The addTxn function will eventually also handle other
Modified: pkg/blotter/man/addTxns.Rd
===================================================================
--- pkg/blotter/man/addTxns.Rd 2012-05-04 11:59:09 UTC (rev 1011)
+++ pkg/blotter/man/addTxns.Rd 2012-05-04 14:02:03 UTC (rev 1012)
@@ -3,7 +3,7 @@
\title{Add multiple transactions to a portfolio}
\usage{
addTxns(Portfolio, Symbol, TxnData, verbose = TRUE, ...,
- ConMult = NULL)
+ ConMult = NULL)
}
\arguments{
\item{Portfolio}{A portfolio name that points to a
Modified: pkg/blotter/man/calcPortfWgt.Rd
===================================================================
--- pkg/blotter/man/calcPortfWgt.Rd 2012-05-04 11:59:09 UTC (rev 1011)
+++ pkg/blotter/man/calcPortfWgt.Rd 2012-05-04 14:02:03 UTC (rev 1012)
@@ -3,8 +3,8 @@
\title{Calculates the portfolio weights for positions within a given portfolio.}
\usage{
calcPortfWgt(Portfolio, Symbols = NULL, Dates = NULL,
- denominator = c("Gross.Value", "Net.Value", "Long.Value",
- "Short.Value"), Account = NULL)
+ denominator = c("Gross.Value", "Net.Value", "Long.Value", "Short.Value"),
+ Account = NULL)
}
\arguments{
\item{Portfolio}{a portfolio object structured with
Modified: pkg/blotter/man/calcPosAvgCost.Rd
===================================================================
--- pkg/blotter/man/calcPosAvgCost.Rd 2012-05-04 11:59:09 UTC (rev 1011)
+++ pkg/blotter/man/calcPosAvgCost.Rd 2012-05-04 14:02:03 UTC (rev 1012)
@@ -3,7 +3,7 @@
\title{Calculates the average cost of a resulting position from a transaction}
\usage{
.calcPosAvgCost(PrevPosQty, PrevPosAvgCost, TxnValue,
- PosQty, ConMult = 1)
+ PosQty, ConMult = 1)
}
\arguments{
\item{PrevPosQty}{quantity of the previous position}
Modified: pkg/blotter/man/chart.Posn.Rd
===================================================================
--- pkg/blotter/man/chart.Posn.Rd 2012-05-04 11:59:09 UTC (rev 1011)
+++ pkg/blotter/man/chart.Posn.Rd 2012-05-04 14:02:03 UTC (rev 1012)
@@ -8,7 +8,9 @@
\item{Portfolio}{string identifying the portfolio to
chart}
- \item{Symbol}{string identifying the symbol 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{Dates}{xts ISO 8601 style subsetting}
Modified: pkg/blotter/man/chart.Reconcile.Rd
===================================================================
--- pkg/blotter/man/chart.Reconcile.Rd 2012-05-04 11:59:09 UTC (rev 1011)
+++ pkg/blotter/man/chart.Reconcile.Rd 2012-05-04 14:02:03 UTC (rev 1012)
@@ -2,9 +2,10 @@
\alias{chart.Reconcile}
\title{Chart trades against market data, position through time, and cumulative P\&L}
\usage{
- chart.Reconcile(theoPort, actualPort, Symbol, Dates =
- NULL, ..., PLdiff = c("cumulative", "episodic"), data =
- c(FALSE, "View", "return"))
+ chart.Reconcile(theoPort, actualPort, Symbol,
+ Dates = NULL, ...,
+ PLdiff = c("cumulative", "episodic"),
+ data = c(FALSE, "View", "return"))
}
\arguments{
\item{theoPort}{string identifying the theoretical
Modified: pkg/blotter/man/chart.Spread.Rd
===================================================================
--- pkg/blotter/man/chart.Spread.Rd 2012-05-04 11:59:09 UTC (rev 1011)
+++ pkg/blotter/man/chart.Spread.Rd 2012-05-04 14:02:03 UTC (rev 1012)
@@ -2,8 +2,8 @@
\alias{chart.Spread}
\title{Charts the transaction series, positions, and P&L of a spread against prices}
\usage{
- chart.Spread(Account, Portfolio, Spread = NULL, Symbols =
- NULL, Dates = NULL, ...)
+ chart.Spread(Account, Portfolio, Spread = NULL,
+ Symbols = NULL, Dates = NULL, ...)
}
\arguments{
\item{Account}{string identifying the account}
Modified: pkg/blotter/man/getBySymbol.Rd
===================================================================
--- pkg/blotter/man/getBySymbol.Rd 2012-05-04 11:59:09 UTC (rev 1011)
+++ pkg/blotter/man/getBySymbol.Rd 2012-05-04 14:02:03 UTC (rev 1012)
@@ -2,8 +2,8 @@
\alias{.getBySymbol}
\title{Retrieves calculated attributes for each position in the portfolio}
\usage{
- .getBySymbol(Portfolio, Attribute, Dates = NULL, Symbols
- = NULL, native = FALSE)
+ .getBySymbol(Portfolio, Attribute, Dates = NULL,
+ Symbols = NULL, native = FALSE)
}
\arguments{
\item{Portfolio}{a portfolio object containing
Modified: pkg/blotter/man/getPos.Rd
===================================================================
--- pkg/blotter/man/getPos.Rd 2012-05-04 11:59:09 UTC (rev 1011)
+++ pkg/blotter/man/getPos.Rd 2012-05-04 14:02:03 UTC (rev 1012)
@@ -2,8 +2,8 @@
\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)
+ getPos(Portfolio, Symbol, Date,
+ Columns = c("Pos.Qty", "Pos.Avg.Cost"), n = 1)
}
\arguments{
\item{Portfolio}{string identifying a portfolio object
Modified: pkg/blotter/man/initAcct.Rd
===================================================================
--- pkg/blotter/man/initAcct.Rd 2012-05-04 11:59:09 UTC (rev 1011)
+++ pkg/blotter/man/initAcct.Rd 2012-05-04 14:02:03 UTC (rev 1012)
@@ -2,8 +2,9 @@
\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", ...)
+ initAcct(name = "default", portfolios,
+ initDate = "1950-01-01", initEq = 0, currency = "USD",
+ ...)
}
\arguments{
\item{name}{Account name, as string}
Modified: pkg/blotter/man/initPortf.Rd
===================================================================
--- pkg/blotter/man/initPortf.Rd 2012-05-04 11:59:09 UTC (rev 1011)
+++ pkg/blotter/man/initPortf.Rd 2012-05-04 14:02:03 UTC (rev 1012)
@@ -3,7 +3,7 @@
\title{Initializes a portfolio object.}
\usage{
initPortf(name = "default", symbols, initPosQty = 0,
- initDate = "1950-01-01", currency = "USD", ...)
+ initDate = "1950-01-01", currency = "USD", ...)
}
\arguments{
\item{name}{A name for the resulting portfolio object}
Modified: pkg/blotter/man/initPosPL.Rd
===================================================================
--- pkg/blotter/man/initPosPL.Rd 2012-05-04 11:59:09 UTC (rev 1011)
+++ pkg/blotter/man/initPosPL.Rd 2012-05-04 14:02:03 UTC (rev 1012)
@@ -3,7 +3,7 @@
\title{initializes position P&L for a portfolio instrument}
\usage{
.initPosPL(initDate = "1950-01-01", ..., initPosQty = 0,
- initConMult = 1, initCcyMult = 1)
+ initConMult = 1, initCcyMult = 1)
}
\arguments{
\item{initDate}{date prior to the first close price
Modified: pkg/blotter/man/updatePortf.Rd
===================================================================
--- pkg/blotter/man/updatePortf.Rd 2012-05-04 11:59:09 UTC (rev 1011)
+++ pkg/blotter/man/updatePortf.Rd 2012-05-04 14:02:03 UTC (rev 1012)
@@ -3,7 +3,7 @@
\title{update Portfilio P&L over a Dates range}
\usage{
updatePortf(Portfolio, Symbols = NULL, Dates = NULL,
- Prices = NULL, ...)
+ Prices = NULL, ...)
}
\arguments{
\item{Portfolio}{string identifying a portfolio}
Modified: pkg/blotter/man/updatePosPL.Rd
===================================================================
--- pkg/blotter/man/updatePosPL.Rd 2012-05-04 11:59:09 UTC (rev 1011)
+++ pkg/blotter/man/updatePosPL.Rd 2012-05-04 14:02:03 UTC (rev 1012)
@@ -2,8 +2,8 @@
\alias{.updatePosPL}
\title{Calculates position PL from the position data and corresponding close price data.}
\usage{
- .updatePosPL(Portfolio, Symbol, Dates = NULL, Prices =
- NULL, ConMult = NULL, ...)
+ .updatePosPL(Portfolio, Symbol, Dates = NULL,
+ Prices = NULL, ConMult = NULL, ...)
}
\arguments{
\item{Portfolio}{a portfolio name to a portfolio
More information about the Blotter-commits
mailing list