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

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Thu Nov 20 18:37:04 CET 2014


Author: bodanker
Date: 2014-11-20 18:37:03 +0100 (Thu, 20 Nov 2014)
New Revision: 1654

Modified:
   pkg/quantstrat/R/osFUNs.R
Log:
- Fix osMaxPos bug; thanks to Offer Markovich for the report


Modified: pkg/quantstrat/R/osFUNs.R
===================================================================
--- pkg/quantstrat/R/osFUNs.R	2014-11-19 20:09:38 UTC (rev 1653)
+++ pkg/quantstrat/R/osFUNs.R	2014-11-20 17:37:03 UTC (rev 1654)
@@ -201,7 +201,7 @@
     if(orderqty<0 & orderside=='short'){
         if ((orderqty+pos)>PosLimit[,"MinPos"]) {
             #we have room to expand the position
-            if(orderqty<=(PosLimit[,"MinPos"]/PosLimit[,"ShortLevels"]) ) {
+            if(orderqty>=(PosLimit[,"MinPos"]/PosLimit[,"ShortLevels"]) ) {
                 orderqty=orderqty
             } else {
                 orderqty = round(PosLimit[,"MinPos"]/PosLimit[,"ShortLevels"],0) #note no round lots



More information about the Blotter-commits mailing list