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

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Thu Dec 23 14:49:48 CET 2010


Author: braverock
Date: 2010-12-23 14:49:47 +0100 (Thu, 23 Dec 2010)
New Revision: 509

Modified:
   pkg/FinancialInstrument/man/FinancialInstrument-package.Rd
   pkg/blotter/DESCRIPTION
   pkg/blotter/R/addTxn.R
Log:
- add Warning on positive transaction fees
- fix description of 'instruments'

Modified: pkg/FinancialInstrument/man/FinancialInstrument-package.Rd
===================================================================
--- pkg/FinancialInstrument/man/FinancialInstrument-package.Rd	2010-12-22 18:44:09 UTC (rev 508)
+++ pkg/FinancialInstrument/man/FinancialInstrument-package.Rd	2010-12-23 13:49:47 UTC (rev 509)
@@ -13,7 +13,7 @@
 
 FinancialInstrument was originally part of a companion package, blotter, that provides portfolio accounting functionality.  Blotter accumulates transactions accumulate into positions, then into portfolios and an account.  FinancialInstrument is used to contain the meta-data about an instrument, which blotter uses to calculate the notional value of positions and the resulting P&L.  FinancialInstrument, however, has plenty of utility beyond portfolio accounting despite it's small size, and was carved out so that others might take advantage of its functionality.
 
-As used here, 'instruments' are xts objects that define contract specifications for price series for a tradable contract, such as corn futures or IBM common stock.  When defined as instruments, these objects are extended to include descriptive information and contract specifications that help identify and value the contract.
+As used here, 'instruments' are S3 objects of type 'instrument' or a subclass thereof that define contract specifications for price series for a tradable contract, such as corn futures or IBM common stock.  When defined as instruments, these objects are extended to include descriptive information and contract specifications that help identify and value the contract.
 
 The simplest example of an instrument is a common stock.  A tradable instrument can be defined in brief terms with an identifier (e.g., "IBM").  Beyond the primary identifier, additional identifiers may be added as well and will work as 'aliases'.  Any identifier will do -- Bloomberg, Reuters-RIC, CUSIP, etc. -- as long as it's unique to the workspace. In addition, a stock price will be denominated in a currency (e.g., "USD") and will have a specific tick size which is the minimum amount that the price can be quoted and transacted in (e.g., $0.01).  We also define a 'multiplier' that is used when calculating the notional value of a position or transaction using a quantity and price (sometimes called a contract multiplier).  For a stock it's usually '1'.  
 

Modified: pkg/blotter/DESCRIPTION
===================================================================
--- pkg/blotter/DESCRIPTION	2010-12-22 18:44:09 UTC (rev 508)
+++ pkg/blotter/DESCRIPTION	2010-12-23 13:49:47 UTC (rev 509)
@@ -1,7 +1,7 @@
 Package: blotter
 Type: Package
 Title: Tools for transaction-oriented trading systems development.
-Version: 0.7.2
+Version: 0.7.3
 Date: $Date$
 Author: Peter Carl, Brian G. Peterson, Joshua Ulrich
 Maintainer: Brian G. Peterson <brian at braverock.com>

Modified: pkg/blotter/R/addTxn.R
===================================================================
--- pkg/blotter/R/addTxn.R	2010-12-22 18:44:09 UTC (rev 508)
+++ pkg/blotter/R/addTxn.R	2010-12-23 13:49:47 UTC (rev 509)
@@ -44,7 +44,8 @@
     # Compute transaction fees if a function was supplied
     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.')
+    
     # Calculate the value and average cost of the transaction
     TxnValue = calcTxnValue(TxnQty, TxnPrice, 0, ConMult) # Gross of Fees
     TxnAvgCost = calcTxnAvgCost(TxnValue, TxnQty, ConMult)
@@ -111,7 +112,7 @@
         } else {
             ConMult<-tmp_instr$multiplier
         }  
-    }    
+    }
 
     for (row in 1:nrow(TxnData)) {
         if(row==1) {



More information about the Blotter-commits mailing list