Help with Custom Volume Average

longshot834

New member
Hi There,

As picture below shown, custom volume average is overlapping my candlestick. Therefore it's very hard to see the candlestick behind it.
Is there a code that I can add it in the chart background so the custom volume average is more transparent so l can see the candlestick

Picture
Code
####################################################################################

#Total Volume for Regular Trading Day
AddLabel(yes, "Total Vol: " + volume(period = AggregationPeriod.DAY), Color.WHITE);

####################################################################################

#Volume of Current Bar
AddLabel(yes, "CurrentBar Vol: " + volume, Color.LIGHT_GREEN);

####################################################################################

#Volume of the Last Bar
AddLabel(yes, "LastBar Vol: " + volume[1], Color.LIGHT_ORANGE);

####################################################################################

#PreMarket Volume
input startTime = 0400;
input endTime = 0929;
def startCounter = SecondsFromTime(startTime);
def endCounter = SecondsTillTime(endTime);
def targetPeriod = if startCounter >= 0 and endCounter >= 0 then 1 else 0;
rec volumeTotal = if targetPeriod and !targetPeriod[1] then volume else if targetPeriod then volumeTotal[1] + volume else volumeTotal[1];
AddLabel(yes, Concat("PreMrket Vol: ", volumeTotal), Color.VIOLET);

####################################################################################

#Volume color coded by amount of volume on up-tick versus amount of volume on down-tick

declare lower;

def O = open;
def H = high;
def C = close;
def L = low;
def V = volume;
def Buying = V * (C - L) / (H - L);
def Selling = V * (H - C) / (H - L);

# Selling Volume
plot SV = Selling;
SV.SetPaintingStrategy(PaintingStrategy.HISTOGRAM);
SV.SetDefaultColor(Color.RED);
SV.HideTitle();
SV.HideBubble();
SV.SetLineWeight(5);

# Buying Volume
# Plot BV = Buying;
# Note that Selling + Buying Volume = Volume.
plot BV = volume;
BV.SetPaintingStrategy(PaintingStrategy.HISTOGRAM);
BV.SetDefaultColor(Color.DARK_GREEN);
BV.HideTitle();
BV.HideBubble();
BV.SetLineWeight(5);

####################################################################################
#Create an average volume line based on last 50 bars

input length = 50;
plot Vol = volume;
plot VolAvg = Average(volume, length);
Vol.SetPaintingStrategy(PaintingStrategy.HISTOGRAM);

####################################################################################

Thank you
 

Similar threads

Not the exact question you're looking for?

Start a new thread and receive assistance from our community.

87k+ Posts
539 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