Posted By: Metzenovich
If / Then on Current CCI(20) - 03/26/21 17:17
Hi,
I'm trying to take different actions based on the current CCI(20).
But all of the squares are red, regardless of the CCI.
I tried this as well, with the same result:
I'm expecting some of the squares to be red and some to be green, based on the CCI(20) at the time.
If I print out the value it looks like I expect, some above 0, some below:
I'm sure I'm just missing something simple...
Thanks!
I'm trying to take different actions based on the current CCI(20).
Code
vars CCIs = series(CCI(20)); if(CCIs[0] >= 0.0){ plot("CCI", 150, SQUARE, GREEN); }else{ plot("CCI", 150, SQUARE, RED); }
But all of the squares are red, regardless of the CCI.
I tried this as well, with the same result:
Code
if(CCI(20) >= 0.0){
I'm expecting some of the squares to be red and some to be green, based on the CCI(20) at the time.
If I print out the value it looks like I expect, some above 0, some below:
Code
printf("\nCCI: %.4f", CCI(20));
I'm sure I'm just missing something simple...
Thanks!