[Blotter-commits] r1610 - pkg/quantstrat/src

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Fri May 9 13:23:40 CEST 2014


Author: bodanker
Date: 2014-05-09 13:23:39 +0200 (Fri, 09 May 2014)
New Revision: 1610

Modified:
   pkg/quantstrat/src/firstCross.c
Log:
- Fix careless copy/paste error from r1609


Modified: pkg/quantstrat/src/firstCross.c
===================================================================
--- pkg/quantstrat/src/firstCross.c	2014-05-08 11:08:00 UTC (rev 1609)
+++ pkg/quantstrat/src/firstCross.c	2014-05-09 11:23:39 UTC (rev 1610)
@@ -31,7 +31,7 @@
         case 2:  /* <  */
             real_x = REAL(x);
             for(i=int_start; i<nrows(x); i++)
-                if(real_x[i] >  real_th) {
+                if(real_x[i] <  real_th) {
                     result = ScalarInteger(i+1);
                     break;
                 }
@@ -39,7 +39,7 @@
         case 3:  /* == */
             real_x = REAL(x);
             for(i=int_start; i<nrows(x); i++)
-                if(real_x[i] >  real_th) {
+                if(real_x[i] == real_th) {
                     result = ScalarInteger(i+1);
                     break;
                 }
@@ -47,7 +47,7 @@
         case 4:  /* >= */
             real_x = REAL(x);
             for(i=int_start; i<nrows(x); i++)
-                if(real_x[i] >  real_th) {
+                if(real_x[i] >= real_th) {
                     result = ScalarInteger(i+1);
                     break;
                 }
@@ -55,7 +55,7 @@
         case 5:  /* <= */
             real_x = REAL(x);
             for(i=int_start; i<nrows(x); i++)
-                if(real_x[i] >  real_th) {
+                if(real_x[i] <= real_th) {
                     result = ScalarInteger(i+1);
                     break;
                 }



More information about the Blotter-commits mailing list