[Blotter-commits] r89 - pkg/R

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Wed Jul 15 04:55:10 CEST 2009


Author: peter_carl
Date: 2009-07-15 04:55:09 +0200 (Wed, 15 Jul 2009)
New Revision: 89

Modified:
   pkg/R/addTxn.R
Log:
- fixed comments about TxnFees
- made transaction function pennyPerShare negative


Modified: pkg/R/addTxn.R
===================================================================
--- pkg/R/addTxn.R	2009-06-09 20:07:44 UTC (rev 88)
+++ pkg/R/addTxn.R	2009-07-15 02:55:09 UTC (rev 89)
@@ -14,7 +14,7 @@
     #   a 'buy'; negative values indicate a 'sell'
     # TxnPrice: price at which the transaction was done
     # TxnFees: fees associated with the transaction, e.g. commissions.  Fees are
-    #   indicated as positive values and will be subtracted from the transaction.
+    #   indicated as negative values and will be subtracted from the transaction value.
     #   TxnFees can either be a fixed amount, or a function of two arguments
     #   Qty and Price in which case the function is evaluated to determine the
     #   fee amount.
@@ -53,7 +53,7 @@
 
 ## example cost function
 pennyPerShare <- function(TxnQty, TxnPrice) {
-    return(TxnQty * 0.01)
+    return(TxnQty * -0.01)
 }
 
 ###############################################################################



More information about the Blotter-commits mailing list