How to Change Value colors within a Label


Category:
0
0

Mr. Hahn:

I have worked with a lot of your information and have created this Label. I use this with six different products on a 2 minute chart intraday trading /NQ futures. It was designed to replace another screen full of Charts. Instead of looking over to another monitor at a chart then the next Etc. , at a glance on my main screen,I see the color of these labels, and I’m able to make decisions more quickly.

The one thing That I miss from my charts is that I was able to create a line at the US open 9:30 Eastern. I leave my charts with overnight trading on because the overnight Gaps will mess up other studies I use for at least the first hour if I don’t. Here is my request. I can’t figure this out.

Assuming this is possible…. I would like if you can make this better and then add code to change the color of the values within the Labels. If the value is greater than the 9:30 Eastern open, color the values white and If the values are lower than the 9:30 Eastern open, color those Black.

I know one of these labels color is white so white values won’t show. They don’t stay white long but if it is a problem I can change the White label to Yellow.

If you have already done this please direct me to it.

I hope I have given you enough information, And thanks for your Time.

Ed

input SYMB = “/VX”;

def VX = close(symbol = SYMB);

def O = open (symbol = SYMB);

AddLabel(1, “/VX: ” + ” = ” + VX, if VX > O then Color.RED else if VX < O then Color.GREEN else Color.WHITE);

# End Code

Marked as spam
Posted by (Questions: 5, Answers: 5)
Asked on September 27, 2019 9:03 am
91 views
0
Private answer

Sorry but at this time Thinkorswim does not permit us to change the color of the text within a chart label. Details here:

https://tlc.thinkorswim.com/center/reference/thinkScript/Functions/Look---Feel/AddLabel.html

One suggestion. Use another label and dynamically set its background color based on your other condition "/VX greater or less than 9:30 open". You can create a label with no text. Just use quotes with empty spaces between: "   "

You can do this on any intraday time frame using recursive variable but not on the daily time frame or higher. Because the daily chart may include the open of the overnight session rather than the regular session open.

Marked as spam
Posted by (Questions: 37, Answers: 4091)
Answered on September 27, 2019 7:16 pm