Vertical Labels??

JP782

Active member
For those who use study indicators with labels is there any way to have the labels display in a vertical column vs across the top of a study or chart? I tried searching here cant find anything on it
 
For those who use study indicators with labels is there any way to have the labels display in a vertical column vs across the top of a study or chart? I tried searching here cant find anything on it
You can workaround the addlabel() function only being horizontally displayed, by using the addchartbubble() function. The major problem is that the bubbles will not scroll as you move around the chart like the addlabel().

The following chart displays bubbles in columns placed in the right expansion area and the same bubbles displaced to the left by use of the bubblemover input (negative numbers move the bubbles to the left).

The bubbles are 'stacked' in a column either from the top or bottom of the chart by having the code declared as a lower indicator and moved to the upper panel, with the left-axis option disabled. The line inputs of 100 and 0 then will be used as a point to anchor the bubbles.

In each of the bubbles is an explanation how to display data.

Capture.jpg

Code:
declare lower;

plot x1=100;
plot y1=0;
x1.setdefaultColor(color.gray);
y1.setdefaultColor(color.gray);


input bubblemover  = 5; #used to move the bubble left and right
def n    = bubblemover;
def n1   = n + 1;
input ud = 5; #used to move the bubble up and down
AddChartBubble(!isnan(close[n1]) and IsNaN(close[n]),
              100,
               "Enter Text Here\nEnter another line of text by using the\nbackwardslash n (\ n) function" + "\nYou can add data eg " + close[n1],
                Color.WHITE, no);
AddChartBubble(!isnan(close[n1]) and IsNaN(close[n]),
              100,
               "Enter Text Here\nEnter another line of text by using the\nbackwardslash n (\ n) function" + "\nYou can add data eg " + close[n1],
                Color.green, no);
AddChartBubble(!isnan(close[n1]) and IsNaN(close[n]),
              100,
               "Enter Text Here\nEnter another line of text by using the\nbackwardslash n (\ n) function" + "\nYou can add data eg " + close[n1],
                Color.red, no);

AddChartBubble(!isnan(close[n1]) and IsNaN(close[n]),
             0,
               "Enter Text Here\nEnter another line of text by using the\nbackwardslash n (\ n) function" + "\nYou can add data eg " + close[n1],
                Color.WHITE, yes);
AddChartBubble(!isnan(close[n1]) and IsNaN(close[n]),
             0,
               "Enter Text Here\nEnter another line of text by using the\nbackwardslash n (\ n) function" + "\nYou can add data eg " + close[n1],
                Color.WHITE, yes);
 
Last edited:
@SleepyZ Nice concept... (y)

Your documentation is incorrect, however... You referred to the \ Backslash as a / Forwardslash... They are named in accordance with the direction the top of the slash leans... Or think of how you would lean, forward or backward if you were walking from left to right across the sceen, in the direction you type...
 
@SleepyZ Nice concept... (y)

Your documentation is incorrect, however... You referred to the \ Backslash as a / Forwardslash... They are named in accordance with the direction the top of the slash leans... Or think of how you would lean, forward or backward if you were walking from left to right across the sceen, in the direction you type...
Thanks for noting the issue. I understand the difference and just typed it wrong. I have edited the code to correct the word to backwordslash..
 
@JP382 It is always helpful when you provide the whole script when asking a question.
I don't have the whole script so the following code is theoretical. The syntax is correct, should work. If not, below are links that will help you write your own chart bubbles.
Ruby:
AddChartBubble (if cond_all1 == 2, close, "MACD L√”, if cond_all1 == 2 then Color.GREEN else Color.RED);

Everything that you want to know about chart bubbles can be found:
https://usethinkscript.com/resources/thinkscript-addchartbubble-add-and-customize-chart-bubbles.13/
https://tlc.thinkorswim.com/center/reference/thinkScript/Functions/Look---Feel/AddChartBubble
No coding ability required
HTH
 

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
368 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