Impossible? "Title" display value colors when values = "N/A" (due to double.nan) should be all black to make true cond. more noticeable when it paints


Active member
I expect this is just a limitation of how ToS works but this is my question:


These values are N/A because the plot conditions are currently not met (therefore double.nan). But it's annoying that the "N/A" text is colored the same as the color of the signal when the conditions are true. Is there a workaround? Like can we use something such as "AssignValueColor(if var == double.nan then CreateColor(0,0,0) else ..."?

I tried that but weirdly, the "N/A" text seemingly can't be black for more than one title value (I tried "Color.Black" for both first and then tried making two slightly different black shades but in either case it didn't work, it gave the result pictured below):


Weird, right? Is anyone familiar with the limitations of ToS in a way that can explain why I can't make both "N/A" values black or gray, or how to work around this?

EDIT: It seems what is happening is that the "N/A" text is just defaulting to those colors no matter what colors I specify for the "else" condition in the AssignValueColor parenthetical. For example, if the blue circled RGB is replaced with "0,255,0" instead of green the first "N/A" circled blue will still be that dark gray color. So what I end up with if I try to change all four to black in the "else" condition is this:


Not quite what I wanted, since I'd rather the "N/A" text be as unnoticeable as possible, but at least now it's not the same color as the true signal condition value. So while the issue is improved, if anyone knows a way to force ThinkOrSwim to display a specified color for an N/A value then please share, but it looks like it's not possible.

EDIT 2: A kind of dumb workaround is forcing ToS to cycle through the default color set by adding dummy nan plots that will be hidden before the plot whose "N/A" value you want to be a dark gray color, like this:

plot dummyplot1 = if 1 == 2 then 0 else double.nan;
plot dummyplot2 = if 1 == 2 then 0 else double.nan;
plot dummyplot3 = if 1 == 2 then 0 else double.nan;
plot dummyplot4 = if 1 == 2 then 0 else double.nan;
plot dummyplot5 = if 1 == 2 then 0 else double.nan;
plot dummyplot6 = if 1 == 2 then 0 else double.nan;
plot dummyplot7 = if 1 == 2 then 0 else double.nan;
plot dummyplot8 = if 1 == 2 then 0 else double.nan;
plot dummyplot9 = if 1 == 2 then 0 else double.nan;

Then those can be hidden but the colors are still forced to cycle to the one you want. Not sure if this is wasting CPU resources significantly but given how simple the plots are, it seems likely that it wouldn't have any real performance impact to use this workaround.
Last edited:

Join useThinkScript to post your question to a community of 21,000+ developers and traders.

Similar threads

Not the exact question you're looking for?

Start a new thread and receive assistance from our community.

87k+ Posts
328 Online
Create Post

Similar threads

Similar threads

The Market Trading Game Changer

Join 2,500+ subscribers inside the useThinkScript VIP Membership Club
  • Exclusive indicators
  • Proven strategies & setups
  • Private Discord community
  • ‘Buy The Dip’ signal alerts
  • Exclusive members-only content
  • Add-ons and resources
  • 1 full year of unlimited support

Frequently Asked Questions

What is useThinkScript?

useThinkScript is the #1 community of stock market investors using indicators and other tools to power their trading strategies. Traders of all skill levels use our forums to learn about scripting and indicators, help each other, and discover new ways to gain an edge in the markets.

How do I get started?

We get it. Our forum can be intimidating, if not overwhelming. With thousands of topics, tens of thousands of posts, our community has created an incredibly deep knowledge base for stock traders. No one can ever exhaust every resource provided on our site.

If you are new, or just looking for guidance, here are some helpful links to get you started.

What are the benefits of VIP Membership?
VIP members get exclusive access to these proven and tested premium indicators: Buy the Dip, Advanced Market Moves 2.0, Take Profit, and Volatility Trading Range. In addition, VIP members get access to over 50 VIP-only custom indicators, add-ons, and strategies, private VIP-only forums, private Discord channel to discuss trades and strategies in real-time, customer support, trade alerts, and much more. Learn all about VIP membership here.
How can I access the premium indicators?
To access the premium indicators, which are plug and play ready, sign up for VIP membership here.