Non Numerical Indicators

cdgardner

New member
I have been trying to convert the SuperTrend indicator to plot as a lower indicator based on color only without returning a numerical value. An example would be if the indicator on the price chart is showing price over plot and showing green, I would like have a lower indicator correspond with a green dot, block, or triangle that does grow and shrink with the spread represented on the price chart. Any help with this is appreciated.

Solution
I have been trying to convert the SuperTrend indicator to plot as a lower indicator based on color only without returning a numerical value. An example would be if the indicator on the price chart is showing price over plot and showing green, I would like have a lower indicator correspond with a green dot, block, or triangle that does grow and shrink with the spread represented on the price chart. Any help with this is appreciated.
Plotting dots, blocks, and triangles is quite possible. However, I don't believe that ToS will allow you to dynamically size the plot. You can change colors for a given plot, but not the shape either.

You would need to set up multiple plots, each of which had the properties you desired (as static...
I have been trying to convert the SuperTrend indicator to plot as a lower indicator based on color only without returning a numerical value. An example would be if the indicator on the price chart is showing price over plot and showing green, I would like have a lower indicator correspond with a green dot, block, or triangle that does grow and shrink with the spread represented on the price chart. Any help with this is appreciated.
Plotting dots, blocks, and triangles is quite possible. However, I don't believe that ToS will allow you to dynamically size the plot. You can change colors for a given plot, but not the shape either.

You would need to set up multiple plots, each of which had the properties you desired (as static properties) and give them a value of 0 when they are to show and double.nan when they are not.

so, as pseudo code (aka copy/paste this won't probably work), you could have
Code:
``````plot large_green_dot = if condition_for_large_green_dot then 0 else double.nan;
plot medium_green_dot = if condition_for_medium_green_dot then 0 else double.nan;
plot small_green_dot = if condition_for_small_green_dot then 0 else double.nan;

large_green_dot.SetPaintingStrategy(PaintingStrategy.POINTS);
medium_green_dot.SetPaintingStrategy(PaintingStrategy.POINTS);
small_green_dot.SetPaintingStrategy(PaintingStrategy.POINTS);

large_green_dot.setLineWeight(5);
medium_green_dot.setLineWeight(3);
small_green_dot.setLineWeight(1);

large_green_dot.setDefaultColor(color.green);
medium_green_dot.setDefaultColor(color.green);
small_green_dot.setDefaultColor(color.green);``````

From that, you could piece together a set of conditions for each of your combinations of shape/size/color properties and have your indicator... perhaps

-mashume

Not the exact question you're looking for?

Start a new thread and receive assistance from our community.

87k+ Posts
297 Online

The Market Trading Game Changer

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

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?