How to toggle on/off all plot lines or labels or things like bubbles?

Mr_Wheeler

Active member
I have a complex study that has different features, but I don't like the idea of having to manually toggle a bunch of things on/off such as the line thickness of all plot lines.

I've done a bunch of things to improve my study such as merging inputs to remove redundant inputs, and cleaning up the formatting of code so you could zip around in the source code to help one trouble shoot it.

This is the next step I would like to take before I update the thread that has my custom indicator.

if showClouds {
AddCloud(Highest_Upper_Band, Low_Upper_Band, Color.WHITE);
AddCloud(High_Low_Band, Lowest_Low_Band, Color.WHITE);
}

I made an indicator that lets me switch between showing either only the labels & many plot lines. I was hoping to also shut off the cloud through the UI instead of having to edit the source code every time I wanted to make the clouds disappear & reappear.
 
I have a complex study that has different features, but I don't like the idea of having to manually toggle a bunch of things on/off such as the line thickness of all plot lines.

I've done a bunch of things to improve my study such as merging inputs to remove redundant inputs, and cleaning up the formatting of code so you could zip around in the source code to help one trouble shoot it.

This is the next step I would like to take before I update the thread that has my custom indicator.

if showClouds {
AddCloud(Highest_Upper_Band, Low_Upper_Band, Color.WHITE);
AddCloud(High_Low_Band, Lowest_Low_Band, Color.WHITE);
}

I made an indicator that lets me switch between showing either only the labels & many plot lines. I was hoping to also shut off the cloud through the UI instead of having to edit the source code every time I wanted to make the clouds disappear & reappear.
These examples should further your quest.
Whether plotting lines, clouds or bubbles, ShowStuff must be yes. When ShowStuff=no then nothing prints.

If you want to turn them off separately, make 3 inputs
ShowPlots, ShowBubbles, ShowWhatever

Ruby:
input ShowStuff = yes ;

plot pHighest_Upper_Band = if ShowStuff then Highest_Upper_Band else double.NaN;

AddChartBubble(ShowStuff and close>open, high, close, color.light_green);

    AddCloud(if(ShowStuff, Highest_Upper_Band, double.NaN), Low_Upper_Band, Color.WHITE);
    AddCloud(if(ShowStuff, High_Low_Band, double.NaN), Lowest_Low_Band, Color.WHITE);


FYI:
AddCloud(if(ShowStuff, Highest_Upper_Band, double.NaN
is a shortcut version of saying:
AddCloud(if ShowStuff then Highest_Upper_Band else double.NAN
Basically, in clouds, you only have to put the if statement in the cloud on any one element; if showstuff=no then the cloud does not print.
 
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
295 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.
Back
Top