Hi coders, I cannot solve a situation to get the shift of first group that meeting the "three straight red bars" from bar100 to bar1.
Kindly have a look at my codes and picture, I want to get the redSf=26 and stop there, and will not carry on to loop till redSf=1.
Kindly provide your correction codes and ensure that if there is no such "three straight red bars" for the last 100 bars and will not cause any looping error. Thanks
Kindly have a look at my codes and picture, I want to get the redSf=26 and stop there, and will not carry on to loop till redSf=1.
Inserted Code
int redSf=0; for(int i=100; i>=1; i--) { double aa=iOpen(symbol,15,i)>iClose(symbol,15,i); double bb=iOpen(symbol,15,i+1)>iClose(symbol,15,i+1); double cc=iOpen(symbol,15,i+2)>iClose(symbol,15,i+2); if(aa && bb && cc) redSf=i; }
Kindly provide your correction codes and ensure that if there is no such "three straight red bars" for the last 100 bars and will not cause any looping error. Thanks