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

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Tue Feb 19 21:40:08 CET 2013


Author: opentrades
Date: 2013-02-19 21:40:06 +0100 (Tue, 19 Feb 2013)
New Revision: 1398

Modified:
   pkg/blotter/R/perTradeStats.R
Log:
- removed format() in computing perTradeStats() timespan, now directly pasting 2 POSIXct objects i.o. unnecessary string conversion



Modified: pkg/blotter/R/perTradeStats.R
===================================================================
--- pkg/blotter/R/perTradeStats.R	2013-02-12 21:14:33 UTC (rev 1397)
+++ pkg/blotter/R/perTradeStats.R	2013-02-19 20:40:06 UTC (rev 1398)
@@ -71,8 +71,9 @@
     # calculate information about each trade
     for(i in 1:length(trades$End))
     {
-        timespan <- paste(format(trades$Start[[i]], "%Y-%m-%d %H:%M:%OS6"),
-                format(trades$End[[i]], "%Y-%m-%d %H:%M:%OS6"), sep="::")
+        #timespan <- paste(format(trades$Start[[i]], "%Y-%m-%d %H:%M:%OS6"),
+                #format(trades$End[[i]], "%Y-%m-%d %H:%M:%OS6"), sep="::")
+        timespan <- paste(trades$Start[[i]], trades$End[[i]], sep="/")
         
         trade <- posPL[timespan]        
 



More information about the Blotter-commits mailing list