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

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Fri Oct 8 15:47:27 CEST 2010


Author: llevenson
Date: 2010-10-08 15:47:27 +0200 (Fri, 08 Oct 2010)
New Revision: 410

Modified:
   pkg/quantstrat/R/orders.R
Log:
- Fixed which logic to evaluate all conditions 
- Removed bug in is.null(side), was is.null(status)


Modified: pkg/quantstrat/R/orders.R
===================================================================
--- pkg/quantstrat/R/orders.R	2010-10-07 20:21:22 UTC (rev 409)
+++ pkg/quantstrat/R/orders.R	2010-10-08 13:47:27 UTC (rev 410)
@@ -86,9 +86,9 @@
     }
 
 	indices <- which(#if(!is.null(timespan)) ordersubset[timespan,which.i=TRUE] else TRUE &
-					 if(!is.null(status)) ordersubset[,"Order.Status"]==status else TRUE &
-					 if(!is.null(ordertype)) ordersubset[,"Order.Type"]==ordertype else TRUE &
-			         if(!is.null(status)) ordersubset[,"Order.Side"]==side else TRUE
+					 (if(!is.null(status)) ordersubset[,"Order.Status"]==status else TRUE) &
+					 (if(!is.null(ordertype)) ordersubset[,"Order.Type"]==ordertype else TRUE) &
+			         (if(!is.null(side)) ordersubset[,"Order.Side"]==side else TRUE)
 					)
 
 	if(isTRUE(which.i)){



More information about the Blotter-commits mailing list