Having trouble getting volume values to appear in title bar.

Tidan

Member
I can get them to appear in a seperate volume indicator I wrote but not with this one. Anyone have any ideas?

Note how the volume values are not appearing in the title bar where it says N/A:
vol2.png


Code:
#declare on_volume;
declare lower;
#declare zerobase;

#to display volume as over/under instead of overlaid.
input over_under = yes;

def V = volume;
def O = open;
def C = close;
def H = high;
def L = low;

def buying = round(V*(C-L)/(H-L),0);
def selling = round(V*(H-C)/(H-L),0);

#irrelevant code snipped#

################################################################
# Option 2 - Total volume is colored red and buying volume is green and layed over
# total volume to show red up top and green below. Can use total volume and
# uncomment SellingVolume for all three to be displayed(must change totalVolume color to gray).
################################################################

# Sell Volume
#Plot SellVol = selling;
#SellVol.setPaintingStrategy(PaintingStrategy.HISTOGRAM);
#SellVol.SetDefaultColor(getColor(5));
#SellVol.HideTitle();
#SellVol.HideBubble();
#SellVol.SetLineWeight(1);

# Buy Volume
Plot BuyVol = if over_under == no then buying else double.nan;
BuyVol.setPaintingStrategy(PaintingStrategy.HISTOGRAM);
BuyVol.SetDefaultColor(getColor(6));
BuyVol.HideTitle();
BuyVol.HideBubble();
BuyVol.SetLineWeight(5);

# Total Volume or paint red to show sell vol up top and buy vol at bottom
plot TotVol = if over_under == no then volume else double.nan;
TotVol.SetPaintingStrategy(PaintingStrategy.HISTOGRAM);
TotVol.SetDefaultColor(getColor(5));
##TotVol.SetDefaultColor(Color.Gray);
TotVol.HideTitle();
TotVol.HideBubble();
TotVol.SetLineWeight(5);

# colored label to show whether buy or sell volume is higher
AddLabel(if over_under == no then yes else no, " Trend ", if buying > selling then color.UPTICK else if selling > buying then color.DOWNTICK else color.GRAY);
 
Last edited:
@Tidan I just installed that code and enabled those either yesterday or the day before... I just checked all of the checkboxes in the Study Settings Panel for the Study as well as those for each plot in the lower section... You can then turn off any you don't want, like bubbles for the plots... You might also notice that I added the ability to select the average type foe the average line... I just can't leave code unmodified...

FdBUJvo.png
 
@Tidan I just installed that code and enabled those either yesterday or the day before... I just checked all of the checkboxes in the Study Settings Panel for the Study as well as those for each plot in the lower section... You can then turn off any you don't want, like bubbles for the plots... You might also notice that I added the ability to select the average type foe the average line... I just can't leave code unmodified...

FdBUJvo.png
How did you get the letters "SV" and "BV" to appear in the title? I like that.
 
@rad14733 I think mine works a little different than yours. Mine shows the total sell volume at the top of the bar and the total buy volume at the bottom. Here it is broken down into a pos/neg histogram. As you can see the volume number value shows up correctly for my pos/neg histogram but on my overlaid/single bar histogram the number value shows N/A.

Update: I found the issue - I had HideTitle() enabled in the code, I'm a dunce.
Question: is it possible to put hideTitle() in a conditional argument? I've tried but its being rejected.

vol1.png
How are you creating the pos/neg histogram in the top indicator in the photo? Mine always looks like the bottom indicator.
 
How did you get the letters "SV" and "BV" to appear in the title? I like that.

@DudeDastic In the Study Settings Panel you just need to check the Show title checkbox for those two plots... Another option would be to place a comment tag "#" at the beginning of the BV.HideTitle(); and BV.HideTitle(); lines, or delete those lines, within the script so they are enabled by default...
 
How are you creating the pos/neg histogram in the top indicator in the photo? Mine always looks like the bottom indicator.
To create the over/under(pos/neg) histogram you can either convert the sell volume to a negative number, e.g.
Code:
Plot sVol = selling - (selling * 2);

Or you can simply prefix it with a minus sign.
Code:
Plot sVol = -selling;
 
Last edited:

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

Not the exact question you're looking for?

Start a new thread and receive assistance from our community.

87k+ Posts
321 Online
Create Post

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