[Blotter-commits] r469 - pkg/blotter/R

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Wed Nov 24 18:02:24 CET 2010


Author: peter_carl
Date: 2010-11-24 18:02:24 +0100 (Wed, 24 Nov 2010)
New Revision: 469

Modified:
   pkg/blotter/R/addTxn.R
Log:
- changes to documentation for pennyPerShare
- deleted an argument for pennyPerShare


Modified: pkg/blotter/R/addTxn.R
===================================================================
--- pkg/blotter/R/addTxn.R	2010-11-24 17:00:06 UTC (rev 468)
+++ pkg/blotter/R/addTxn.R	2010-11-24 17:02:24 UTC (rev 469)
@@ -81,10 +81,10 @@
 
 #' example TxnFee cost function
 #' @param TxnQty total units (such as shares or contracts) transacted.  Positive values indicate a 'buy'; negative values indicate a 'sell'
-#' @param TxnPrice  price at which the transaction was done
+#' This is an example intended to demonstrate how a cost function could be used in place of a flat numeric fee.
 #' @export
-pennyPerShare <- function(TxnQty, TxnPrice) {
-    return(TxnQty * -0.01)
+pennyPerShare <- function(TxnQty) {
+    return(abs(TxnQty) * -0.01)
 }
 
 #' add multiple transactions to a portfolio, partially vectorized



More information about the Blotter-commits mailing list