Gamestudio Links
Zorro Links
Newest Posts
M1 Oversampling
by Petra. 04/24/24 10:34
Zorro FIX plugin - Experimental
by flink. 04/21/24 07:12
Data from CSV not parsed correctly
by EternallyCurious. 04/20/24 21:39
Scripts not found
by juergen_wue. 04/20/24 18:51
zorro 64bit command line support
by 7th_zorro. 04/20/24 10:06
StartWeek not working as it should
by jcl. 04/20/24 08:38
folder management functions
by VoroneTZ. 04/17/24 06:52
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
5 registered members (Petra, AndrewAMD, Quad, VoroneTZ, 1 invisible), 488 guests, and 3 spiders.
Key: Admin, Global Mod, Mod
Newest Members
Mega_Rod, EternallyCurious, howardR, 11honza11, ccorrea
19048 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
If / Then on Current CCI(20) #482767
03/26/21 17:17
03/26/21 17:17
Joined: Mar 2021
Posts: 4
Metzenovich Offline OP
Guest
Metzenovich  Offline OP
Guest

Joined: Mar 2021
Posts: 4
Hi,

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!

Re: If / Then on Current CCI(20) [Re: Metzenovich] #482768
03/26/21 18:15
03/26/21 18:15
Joined: Jul 2000
Posts: 27,982
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,982
Frankfurt
Yes. Name the plots "CCIRED" and "CCIGREEN". Otherwise the red will be angry at the green when it has the same name.

Re: If / Then on Current CCI(20) [Re: jcl] #482769
03/26/21 20:23
03/26/21 20:23
Joined: Mar 2021
Posts: 4
Metzenovich Offline OP
Guest
Metzenovich  Offline OP
Guest

Joined: Mar 2021
Posts: 4
Thanks! I knew the type (SQUARE, DOT, etc) couldn't be changed within a given plot name, but didn't realize that applied to the color as well.


Moderated by  Petra 

Powered by UBB.threads™ PHP Forum Software 7.7.1