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

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Tue Feb 21 23:30:02 CET 2012


Author: braverock
Date: 2012-02-21 23:30:02 +0100 (Tue, 21 Feb 2012)
New Revision: 936

Modified:
   pkg/quantstrat/R/traderules.R
Log:
- fix error where exit order qty would cross zero, thanks to Joe Dunn for the report

Modified: pkg/quantstrat/R/traderules.R
===================================================================
--- pkg/quantstrat/R/traderules.R	2012-02-21 22:15:43 UTC (rev 935)
+++ pkg/quantstrat/R/traderules.R	2012-02-21 22:30:02 UTC (rev 936)
@@ -310,7 +310,7 @@
 		if ((orderqty+pos)>=0) {
             return(orderqty)
         } else {
-			orderqty<-pos #flatten position, don't cross through zero
+			orderqty <- -pos #flatten position, don't cross through zero
             #TODO add code to break into two orders?
             return(orderqty)
         }



More information about the Blotter-commits mailing list