[Blotter-commits] r1582 - pkg/quantstrat/R

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Wed Jan 15 16:20:23 CET 2014


Author: bodanker
Date: 2014-01-15 16:20:22 +0100 (Wed, 15 Jan 2014)
New Revision: 1582

Modified:
   pkg/quantstrat/R/tradeOrderStats.R
Log:
- ensure closed.xts indexTZ is same as orderbook


Modified: pkg/quantstrat/R/tradeOrderStats.R
===================================================================
--- pkg/quantstrat/R/tradeOrderStats.R	2013-12-16 01:43:42 UTC (rev 1581)
+++ pkg/quantstrat/R/tradeOrderStats.R	2014-01-15 15:20:22 UTC (rev 1582)
@@ -44,7 +44,7 @@
 	stats.xts <- as.xts(stats.table, order.by=stats.table$End)
 	orderbook <- getOrderBook(portfolio=portfolio)[[portfolio]][[symbol]]
 	closed <- orderbook[which(orderbook$Order.Status=='closed'),]
-	closed.xts <- xts(closed, as.POSIXct(as.vector(closed$Order.StatusTime), format='%Y-%m-%d %H:%M:%OS'))
+	closed.xts <- xts(closed, as.POSIXct(as.character(closed$Order.StatusTime), tz=indexTZ(closed), format="%Y-%m-%d %H:%M:%OS"))
 	merged.table <- merge(closed.xts,stats.xts)
 	merged.closed <- merged.table[index(stats.xts)]
 	return(merged.closed)



More information about the Blotter-commits mailing list