Daily Volume Incorrect?

mchapma72

New member
I had copied this script a couple years ago and it was working fine in ToS. The daily volume would match the volume in my watchlist. The calculation for the 50 day average volume was correct. Now the daily volume doesn't match the daily volume in the ToS watchlist. In the image below the daily volume is off by 263,800,014. The daily volume is extremely off for every stock in the watchlist and my other watchlists. Here is the script that I have been using and only notice this volume being off on Friday, 10/18/24.

Does anyone see any error in the script below or do you have another script that will show the volume for Buyers and Sellers?

Thanks in Advance,

Mark

plot Data = close;
declare lower;
declare zerobase;

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

#Replace the two lines below to accommodate unfilled gaps
#def Selling = V * (H - C) / (H - L);
#def Buying = V * (C - L) / (H - L);

# Unfilled Gap down: Use prior close as high
def equivHi = if H < C[1] then C[1] else H;
# Unfilled Gap up: Use prior close as low
def equivLo = if L > C[1] then C[1] else L;

def Buying = Round(V * (C - equivLo) / (equivHi - equivLo), 0);
def Selling = Round(V * (equivHi - C) / (equivHi - equivLo), 0);

# Selling Volume
plot SV = Selling;
SV.SetPaintingStrategy(PaintingStrategy.HISTOGRAM);
SV.SetDefaultColor(CreateColor(255, 0, 0)); #Red
SV.SetLineWeight(1);
#SV.hide();

# Buying Volume
plot BV = Buying;
BV.SetPaintingStrategy(PaintingStrategy.HISTOGRAM);
BV.SetDefaultColor(CreateColor(0, 255, 0));
BV.SetLineWeight(5);
#BV.hide()
 

Attachments

  • TOS_buySellVolumeOFF.jpg
    TOS_buySellVolumeOFF.jpg
    359.5 KB · Views: 26

Similar threads

Not the exact question you're looking for?

Start a new thread and receive assistance from our community.

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