How to create a variable that show value but not plot on chart

pypl

New member
Hi,
I want to create a variable that stores and shows values on the value section of indicator but NOT plot on chart.
Can you please help?
For example, I want to show value of Volume on a barheight() indicator. Clear they are on different scale, so showing both value will mess up the indicator.
Thanks,
HHC
 
Solution
CSS:
@pypl
    
# Big Candles code by BenTen
# Assembled by BenTen at UseThinkScript.com
# Converted from https://www.tradingview.com/script/e2fWFUIo-Big-Candles-v1/

input barHeight = 5;

def bigUp = close > open and high-low > barHeight;
def bigDown = close < open and high-low > barHeight;

plot upCandle = bigUp;
upCandle.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_UP);
upCandle.SetLineWeight(1);
upCandle.AssignValueColor(COLOR.CYAN);
plot downCandle = bigDown;
downCandle.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_DOWN);
downCandle.SetLineWeight(1);
downCandle.AssignValueColor(COLOR.MAGENTA);


#------ added/README
# Many ways but here is one. 
# Another would be to create the variables and use SetPaintingStrategy to...
CSS:
@pypl
    
# Big Candles code by BenTen
# Assembled by BenTen at UseThinkScript.com
# Converted from https://www.tradingview.com/script/e2fWFUIo-Big-Candles-v1/

input barHeight = 5;

def bigUp = close > open and high-low > barHeight;
def bigDown = close < open and high-low > barHeight;

plot upCandle = bigUp;
upCandle.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_UP);
upCandle.SetLineWeight(1);
upCandle.AssignValueColor(COLOR.CYAN);
plot downCandle = bigDown;
downCandle.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_DOWN);
downCandle.SetLineWeight(1);
downCandle.AssignValueColor(COLOR.MAGENTA);


#------ added/README
# Many ways but here is one. 
# Another would be to create the variables and use SetPaintingStrategy to paintingStrategy.VaLUES_ABOVE
# /below for those variables. 
# Yet other ways would be to create labels or vertical lines

# params:      condition, location,   display volume,      color,      no = down, yes = up
AddChartBubble(upCandle,   low  -0.1,        volume,        Color.CYAN, no ); # -0.1 moves it lower
AddChartBubble(downCandle, high +0.1,    volume,        Color.PINK, yes ); # +0.1 moves it higher
 
Solution
Thank you for your response.
I add the few lines below so the Volume number shown on top of the arrow and on the "status section" next to the "no" and "yes".
However, what I need it that number NOT shown on the chart area, but JUST on the "status area", just like the "no" and "yes".

HHC

Code:
plot volume_number = volume;
volume_number.SetPaintingStrategy(PaintingStrategy.VaLUES_ABOVE);
 
Thank you for your response.
I add the few lines below so the Volume number shown on top of the arrow and on the "status section" next to the "no" and "yes".
However, what I need it that number NOT shown on the chart area, but JUST on the "status area", just like the "no" and "yes".

HHC

Code:
plot volume_number = volume;
volume_number.SetPaintingStrategy(PaintingStrategy.VaLUES_ABOVE);
@pypl
I am not sure that i am catching your drift... As coded by you, plotting vol_num as values_above will always plot the volume on every bar. In order for others to be on the same page you need to publish your pic and/or your code
 
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
422 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