[Blotter-commits] r196 - pkg/blotter/man

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Sun Jan 24 16:48:55 CET 2010


Author: peter_carl
Date: 2010-01-24 16:48:55 +0100 (Sun, 24 Jan 2010)
New Revision: 196

Added:
   pkg/blotter/man/calcPosValue.Rd
Modified:
   pkg/blotter/man/calcPosAvgCost.Rd
   pkg/blotter/man/calcRealizedPL.Rd
   pkg/blotter/man/calcTxnAvgCost.Rd
   pkg/blotter/man/calcTxnValue.Rd
Log:
- fixed calculations to show contract multiplier
- added contract multiplier


Modified: pkg/blotter/man/calcPosAvgCost.Rd
===================================================================
--- pkg/blotter/man/calcPosAvgCost.Rd	2010-01-23 18:18:34 UTC (rev 195)
+++ pkg/blotter/man/calcPosAvgCost.Rd	2010-01-24 15:48:55 UTC (rev 196)
@@ -12,10 +12,12 @@
   \item{PrevPosAvgCost}{ Average cost of the previous position }
   \item{TxnValue}{ Total value of the current transaction, net of fees }
   \item{PosQty}{ Total units (shares) of the resulting position }
+  \item{ConMult}{ Multiplier required from contract specifications, default=1 }
 }
 \details{
     Calculated as:
-        (PrevPosQty * PrevPosAvgCost + TxnValue)/PosQty
+        PosAvgCost = (PrevPosQty * PrevPosAvgCost * ConMult +
+            TxnValue)/(PosQty * ConMult)
 }
 \value{
   Numeric value of the average cost of the resulting position.

Added: pkg/blotter/man/calcPosValue.Rd
===================================================================
--- pkg/blotter/man/calcPosValue.Rd	                        (rev 0)
+++ pkg/blotter/man/calcPosValue.Rd	2010-01-24 15:48:55 UTC (rev 196)
@@ -0,0 +1,33 @@
+\name{calcTxnValue}
+\alias{calcTxnValue}
+\title{ Calculate the notional value of a position }
+\description{
+  Calculates the notional value of a position.
+}
+\usage{
+    calcPosValue(PosQty, ClosePrice, ConMult=1)
+}
+\arguments{
+  \item{PosQty}{ The number of units (shares, contracts) owned }
+  \item{ClosePrice}{ The market settlement price for the period }
+  \item{ConMult}{ Multiplier required from contract specifications, default=1 }
+}
+\details{
+    Calculated as:
+	PosValue = PosQty * ClosePrice * ConMult
+}
+\value{
+  Numeric value representing the total currency (dollar) value of the position, net of fees
+}
+\author{ Peter Carl }
+\note{ 
+    The contract multiplier should be passed in for other types of instruments.
+}
+\seealso{ \code{\link{getPos}}, \code{\link{getPosQty}} }
+\examples{
+    calcPosValue(PosQty=10, ClosePrice=10, ConMult=100) # == 10000
+}
+% Add one or more standard keywords, see file 'KEYWORDS' in the
+% R documentation directory.
+\keyword{ utilities }
+\keyword{ manip }

Modified: pkg/blotter/man/calcRealizedPL.Rd
===================================================================
--- pkg/blotter/man/calcRealizedPL.Rd	2010-01-23 18:18:34 UTC (rev 195)
+++ pkg/blotter/man/calcRealizedPL.Rd	2010-01-24 15:48:55 UTC (rev 196)
@@ -5,7 +5,7 @@
   Calculates any realized gain or loss resulting from a transaction
 }
 \usage{
-calcRealizedPL(TxnQty, TxnAvgCost, PrevPosAvgCost, PosQty, PrevPosQty)
+calcRealizedPL(TxnQty, TxnAvgCost, PrevPosAvgCost, PosQty, PrevPosQty, ConMult = 1)
 }
 %- maybe also 'usage' for other objects documented here.
 \arguments{
@@ -14,6 +14,7 @@
   \item{PrevPosAvgCost}{ average position cost of the previous position }
   \item{PosQty}{ total units (shares) of the resulting position }
   \item{PrevPosQty}{ quantity of the previous position }
+  \item{ConMult}{ multiplier required from contract specifications, default=1 }
 }
 \details{
     Calculated using the following conditions:
@@ -24,7 +25,7 @@
     - if prev position is negative and position is larger, OR
     - if prev position is positive and position is smaller,
     then calc RealizedPL as:
-        RealizedPL = TxnQty * (PrevPosAvgCost - TxnAvgCost)
+        RealizedPL = TxnQty * ConMult * (PrevPosAvgCost - TxnAvgCost)
 
 }
 \value{
@@ -32,7 +33,7 @@
 }
 \author{ Peter Carl }
 \note{ 
-    Note that the multiplier is missing for other types of instruments
+    The contract multiplier should be passed in for other types of instruments.
 }
 \seealso{ \code{\link{addTxn}}, \code{\link{getTxn}}, \code{\link{getPosAvgCost}}, \code{\link{calcTxnAvgCost}} }
 \examples{

Modified: pkg/blotter/man/calcTxnAvgCost.Rd
===================================================================
--- pkg/blotter/man/calcTxnAvgCost.Rd	2010-01-23 18:18:34 UTC (rev 195)
+++ pkg/blotter/man/calcTxnAvgCost.Rd	2010-01-24 15:48:55 UTC (rev 196)
@@ -10,14 +10,18 @@
 \arguments{
   \item{TxnValue}{ total value of the transaction, including fees }
   \item{TxnQty}{ total units (shares) of the transaction }
+  \item{ConMult}{ multiplier required from contract specifications, default=1 }
 }
-
+\details{
+    Calculated as:
+        TxnAvgCost = TxnValue/(TxnQty * ConMult)
+}
 \value{
   Numeric value of the unit normalized (e.g., per share) cost implied by the transaction.
 }
 \author{ Peter Carl }
 \note{ 
-    Note that the multiplier is missing for other types of instruments
+    The contract multiplier should be passed in for other types of instruments.
 }
 \seealso{ \code{\link{getTxn}}, \code{\link{addTxn}} }
 \examples{

Modified: pkg/blotter/man/calcTxnValue.Rd
===================================================================
--- pkg/blotter/man/calcTxnValue.Rd	2010-01-23 18:18:34 UTC (rev 195)
+++ pkg/blotter/man/calcTxnValue.Rd	2010-01-24 15:48:55 UTC (rev 196)
@@ -5,23 +5,24 @@
   Calculates the notional value of a transaction, net of any fees associated.
 }
 \usage{
-    calcTxnValue(TxnQty, TxnPrice, TxnFees)
+    calcTxnValue(TxnQty, TxnPrice, TxnFees, ConMult=1)
 }
 \arguments{
   \item{TxnQty}{ The number of units (shares, contracts) traded }
   \item{TxnPrice}{ The market clearing price of the transaction }
   \item{TxnFees}{ The total fees associated with the transaction, with expenses represented as a positive number.  The aggregate of, for example, commissions, ticket charges, exchange fees, etc. }
+  \item{ConMult}{ multiplier required from contract specifications, default=1 }
 }
 \details{
     Calculated as:
-        TxnValue = TxnQty * TxnPrice - TxnFees
+        TxnValue = TxnQty * TxnPrice * ConMult - TxnFees
 }
 \value{
   Numeric value representing the total currency (dollar) value of the transaction, net of fees
 }
 \author{ Peter Carl }
 \note{ 
-Note that the multiplier is missing for other types of instruments.
+    The contract multiplier should be passed in for other types of instruments.
 }
 \seealso{ \code{\link{getTxn}}, \code{\link{getTxnFees}}, \code{\link{getTxnValue}} }
 \examples{



More information about the Blotter-commits mailing list