Volume average for intraday time period?

dj45

Member
I'm guessing someone has already done this, but I couldn't find via search.

It would be interesting see the volume average on /ES for a given intraday time interval. For example, at 11am, I'd like to know how today's volume compares to the average of the last x days' volume to 11am. And be able to see that comparison at any time of the day, meaning, at 2pm, I'd be seeing today's volume compared to avg of prior x days' volume to 2pm.

When we look at traditional volume averages, the average isn't comparable to today's volume until today is closed because the average is including full sessions for the days included in the average.
 
Last edited:

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

I'm guessing someone has already done this, but I couldn't find via search.

It would be interesting see the volume average on /ES for a given intraday time interval. For example, at 11am, I'd like to know how today's volume compares to the average of the last x days' volume to 11am. And be able to see that comparison at any time of the day, meaning, at 2pm, I'd be seeing today's volume compared to avg of prior x days' volume to 2pm.

When we look at traditional volume averages, the average isn't comparable to today's volume until today is closed because the average is including full sessions for the days included in the average.

i think you are asking about time based volume. take a look at this
https://usethinkscript.com/threads/time-based-volume-indicator-for-thinkorswim.124/
 
@dj45 I'm modifying an indicator I wrote for another user, https://usethinkscript.com/threads/average-volume-for-first-bar-of-the-day.10449/#post-93149 post #13, to fit your needs. Have a couple questions, Chart label or chart bubble? Upper or lower chart? Do you want to compare average of last x days to the current days range of bars total or current days range average or just the current bars volume?
@Svanoy, thanks. I think what @halcyonguy pointed me to is pretty much what I'm looking for.
i think you are asking about time based volume. take a look at this
https://usethinkscript.com/threads/time-based-volume-indicator-for-thinkorswim.124/
@halcyonguy, yes, I think that's it, thanks. Seems it doesn't work with extended hours turned on. I'll have to look at the script later to understand if it's doing exactly what I want, but from descriptions of 'time based volume', it looks like it is.
 
i think what you are looking for is called AVAT ... average volume at time ...

AVERAGE VOLUME AT TIME = AVAT
Relative Intraday Volume
by Mobius
Code:
# Relative Intraday Volume to 5 Previous Days
# Mobius
# Chat Room Request 06.01.2021

declare hide_on_Daily;
declare lower;

plot v = volume;
     v.SetPaintingStrategy(PaintingStrategy.Points);
     v.SetLineWeight(3);
def start = getTime() crosses above RegularTradingStart(getYYYYMMDD());
def RTH = getTime() >= RegularTradingStart(getYYYYMMDD()) and
          getTime() <= RegularTradingEnd(getYYYYMMDD());
def GBX = getTime() > RegularTradingEnd(getYYYYMMDD()) and
          getTime() < RegularTradingStart(getYYYYMMDD());
def x = barNumber();
def x0 = if isNaN(close[-1]) and !isNaN(close) then x else x0[1];
def xt  = if start
          then x
          else xt[1];
def xt1 = if start
          then xt[1]
          else xt1[1];
def n1 = if RTH and !RTH[1]
         then x-xt1
         else n1[1];
plot xv1 = if !RTH then double.nan else getValue(v, n1);
     xv1.SetPaintingStrategy(PaintingStrategy.Squares);
def xt2 = if start
          then xt1[1]
          else xt2[1];
def n2 = if RTH and !RTH[1]
         then x-xt2
         else n2[1];
plot xv2 = if !RTH then double.nan else  getValue(v, n2);
     xv2.SetPaintingStrategy(PaintingStrategy.Squares);
def xt3 = if start
          then xt2[1]
          else xt3[1];
def n3 = if RTH and !RTH[1]
         then x-xt3
         else n3[1];
plot xv3 = if !RTH then double.nan else  getValue(v, n3);
     xv3.SetPaintingStrategy(PaintingStrategy.Squares);
def xt4 = if start
          then xt3[1]
          else xt4[1];
def n4 = if RTH and !RTH[1]
         then x-xt4
         else n4[1];
plot xv4 = if !RTH then double.nan else  getValue(v, n4);
     xv4.SetPaintingStrategy(PaintingStrategy.Squares);
def xt5 = if start
          then xt4[1]
          else xt5[1];
def n5 = if RTH and !RTH[1]
         then x-xt5
         else n5[1];
plot xv5 = if !RTH then double.nan else  getValue(v, n5);
     xv5.SetPaintingStrategy(PaintingStrategy.Squares);
plot Avg = if !RTH then double.nan else (v + xv1 + xv2 + xv3 + xv4 + xv5) / 6;
     Avg.SetStyle(Curve.Firm);
     Avg.SetDefaultColor(Color.green);
     Avg.SetLineWeight(2);
addLabel(1, "Avg", Avg.TakeValueColor());
addLabel(1, "Today", v.TakeValueColor());
addLabel(1, "-1D", xv1.TakeValueColor());
addLabel(1, "-2D", xv2.TakeValueColor());
addLabel(1, "-3D", xv3.TakeValueColor());
addLabel(1, "-4D", xv4.TakeValueColor());
addLabel(1, "-5D", xv5.TakeValueColor());
# End Code


reference:
1689916608766.png
 

Similar threads

Not the exact question you're looking for?

Start a new thread and receive assistance from our community.

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