Why does ilowest skip many matches in a loop

Back to topics list To post a new topic, please log in or register
avatar
12
fastbucks 2016.06.14 16:34
 
  // This works,but ilowest below ,skips matches.
  &&  iLow(NULL,PERIOD_M1,ee4t)< iLow(NULL,PERIOD_M1,ee4t+2)
   &&  iLow(NULL,PERIOD_M1,ee4t)< iLow(NULL,PERIOD_M1,ee4t+1)
   &&  iLow(NULL,PERIOD_M1,ee4t)< iLow(NULL,PERIOD_M1,ee4t-1)
   &&  iLow(NULL,PERIOD_M1,ee4t)< iLow(NULL,PERIOD_M1,ee4t-2) 
 
  // ilowest skips many ee4t matches for the lowest 
// ee4t in an +1 incremented loop search in a several hundred
// bars search for matches within specific price ranges and
// 2 bars before and 2 after, ee4t.But the 4  // ilow statements above // find every 
// match every time. Have increased sleep time with no effect. And // have tested many examples. 

  && iLowest(NULL,PERIOD_M1,MODE_LOW,ee4t+2,ee4t-2)==ee4t 

avatar
Moderator
3418
GumRai 2016.06.14 20:57 #
 

What do you mean? Skips matches?

 && iLowest(NULL,PERIOD_M1,MODE_LOW,ee4t+2,ee4t-2)==ee4t 

Maybe you mean

 && iLowest(NULL,PERIOD_M1,MODE_LOW,5,ee4t-2)==ee4t 

?

avatar
13001
WHRoeder 2016.06.14 23:12 #
 
 && iLowest(NULL,PERIOD_M1,MODE_LOW,ee4t+2,ee4t-2)==ee4t 
Self documenting your code would generate a length of 5 as GumRai pointed out.
int iLast  = ee4t+2;
int iFirst = ee4t-2;
int length = iLast - iFirst + 1;

 && iLowest(NULL,PERIOD_M1,MODE_LOW,length,iFirst)==ee4t 

avatar
12
fastbucks 2016.06.15 10:14 #
 
WHRoeder:
Self documenting your code would generate a length of 5 as GumRai pointed out.

It works now...thanks again...
Back to topics list  

To add comments, please log in or register