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

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Wed Apr 15 04:33:21 CEST 2015


Author: bodanker
Date: 2015-04-15 04:33:20 +0200 (Wed, 15 Apr 2015)
New Revision: 1685

Modified:
   pkg/blotter/R/addTxn.R
Log:
Update txnfees if txn takes position across zero

Update txnfees (instead of TxnFees) when a transaction causes the
position to cross zero. txnfees, not TxnFees, is used when creating
the new transaction, so the updated transaction fee was not being
used for the second transaction.

Thanks to Ivan Popivanov for the report and patch.


Modified: pkg/blotter/R/addTxn.R
===================================================================
--- pkg/blotter/R/addTxn.R	2015-04-09 18:39:29 UTC (rev 1684)
+++ pkg/blotter/R/addTxn.R	2015-04-15 02:33:20 UTC (rev 1685)
@@ -100,7 +100,7 @@
         TxnDate=TxnDate+2*eps #transactions need unique timestamps, so increment a bit
         TxnQty=TxnQty+PrevPosQty
         PrevPosQty=0
-        TxnFees=txnFeeQty*abs(TxnQty+PrevPosQty)
+        txnfees=txnFeeQty*abs(TxnQty+PrevPosQty)
     }
     
     if(is.null(ConMult) | !hasArg(ConMult)){



More information about the Blotter-commits mailing list