[Blotter-commits] r1080 - pkg/quantstrat/R
noreply at r-forge.r-project.org
noreply at r-forge.r-project.org
Thu Jun 28 11:00:45 CEST 2012
Author: opentrades
Date: 2012-06-28 11:00:44 +0200 (Thu, 28 Jun 2012)
New Revision: 1080
Modified:
pkg/quantstrat/R/ruleOrderProc.R
Log:
* applied format to orderbook Order.StatusTime printout to ensure printing of 00:00:00 for midnight, in 4 locations, ruleOrderProc.R
Modified: pkg/quantstrat/R/ruleOrderProc.R
===================================================================
--- pkg/quantstrat/R/ruleOrderProc.R 2012-06-28 08:47:13 UTC (rev 1079)
+++ pkg/quantstrat/R/ruleOrderProc.R 2012-06-28 09:00:44 UTC (rev 1080)
@@ -215,7 +215,8 @@
,...=..., TxnFees=txnfees)
if (is.null(neworders)) neworders=neworder else neworders = rbind(neworders,neworder)
ordersubset[ii,"Order.Status"]<-'replaced'
- ordersubset[ii,"Order.StatusTime"]<-as.character(timestamp)
+# ordersubset[ii,"Order.StatusTime"]<-as.character(timestamp)
+ ordersubset[ii,"Order.StatusTime"]<-format(timestamp, "%Y-%m-%d %H:%M:%S")
next()
}
}
@@ -286,7 +287,8 @@
,...=..., TxnFees=txnfees)
if (is.null(neworders)) neworders=neworder else neworders = rbind(neworders,neworder)
ordersubset[ii,"Order.Status"]<-'replaced'
- ordersubset[ii,"Order.StatusTime"]<-as.character(as.POSIXlt(statustimestamp, Sys.getenv('TZ')))
+ #ordersubset[ii,"Order.StatusTime"]<-as.character(as.POSIXlt(statustimestamp, Sys.getenv('TZ')))
+ ordersubset[ii,"Order.StatusTime"]<-format(timestamp, "%Y-%m-%d %H:%M:%S")
next()
}
}
@@ -314,7 +316,8 @@
TxnQty=orderQty, TxnPrice=txnprice , ...=..., TxnFees=txnfees)
ordersubset[ii,"Order.Status"]<-'closed'
}
- ordersubset[ii,"Order.StatusTime"]<-as.character(timestamp)
+# ordersubset[ii,"Order.StatusTime"]<-as.character(timestamp)
+ ordersubset[ii,"Order.StatusTime"]<-format(timestamp, "%Y-%m-%d %H:%M:%S")
#close all other orders in the same order set
OrdersetTag = toString(ordersubset[ii,"Order.Set"])
@@ -324,7 +327,8 @@
if(length(OpenInOrderset.i) > 0)
{
ordersubset[OpenInOrderset.i, "Order.Status"] = 'canceled'
- ordersubset[OpenInOrderset.i, "Order.StatusTime"]<-as.character(timestamp)
+# ordersubset[OpenInOrderset.i, "Order.StatusTime"]<-as.character(timestamp)
+ ordersubset[OpenInOrderset.i, "Order.StatusTime"]<-format(timestamp, "%Y-%m-%d %H:%M:%S")
}
}
} #end loop over open orders
More information about the Blotter-commits
mailing list