The benefit of using Color.UPTICK vs. Color.Blue

Englewood85

New member
In this code, I am using UPTICK and DOWNTICK as a color. Not sure how UPTICK and DOWNTICK can be actual colors though.

Code:
declare lower;
input length = 12;
plot Momentum = close - close[length];
Momentum.DefineColor("Positive", Color.UPTICK);
Momentum.DefineColor("Negative", Color.DOWNTICK);
Momentum.AssignValueColor(if Momentum >= 0 then Momentum.Color("Positive") else Momentum.Color("Negative"));


Here I am hardcoding specific colors instead of using UPTICK and DOWNTICK

Code:
declare lower;
input length = 12;
plot Momentum = close - close[length];
Momentum.DefineColor("Positive", Color.BLUE);
Momentum.DefineColor("Negative", Color.GREEN);
Momentum.AssignValueColor(if Momentum >= 0 then Momentum.Color("Positive") else Momentum.Color("Negative"));


Here are my questions:

1. Whether I use UPTICK/DOWNTICK vs. BLUE/GREEN, either way I can open the properties window and change colors. So what is the benefit of using UPTICK/DOWNTICK instead of hardcoding specific colors?

2. Whether I use UPTICK or BLUE, thinkScript knows that the color choosen corresponds to an upward movement. This is true even if I change the color name "Positive" to something else. When I change the color (for example to orange) in the GUI for the first color choice (which is the one labeled "Positive"), how does thinkScript automatically know that the color I changed to (orange) corresponds to the upward movement of the plotted line?

3. Is there anyway to select a block of lines, then comment out those lines all at once, instead of line by line?
 

BenTen

Administrative
Staff member
Staff
VIP
You can see a set of constants for colors here.

Uptick is basically light green and Downtick is light red.

I don't think the system knows if orange is bullish or bearish, you have to define that in your script.
 

Similar threads

Top