Volume Forecast (VF) Indicator for ThinkorSwim

Status
Not open for further replies.

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

Almost seems like you were trying to hype a product from the way you sounded like you had it but didn't have it.. aside from that point ..
since the title of this is "volume forecast" here is my version of it, obviously it wont be the same as yours since the formula is different. As others in the thread have stated, it seems more like hype that anything else, but here goes the code for whoever can find it useful.

Note: Every timeframe will be different as it "forecasts" by the closest volume bars. If you want it relative to the Daily then use the day, if you want it relative to the minute then use the minute, if you want it relative to 30 mins, then use 30 mins and so on. It "Forecasts" till the closing bell, will not factor in afterhours.

sKQu40y.png


Code:
#Volume ForeCast v1.0 by XeoNoX via usethinkscript.com
#Note: Every timeframe will be different as it "forecasts" by the closest volume.
# If you want it relative to the Daily then use the day, if you want it relative to the minute then use the minute, if you want it relative to 30 mins, then use 30 mins and so on.
# It "Forecasts" till the closing bell, will not factor in afterhours.

def Daily_Total_Vol = volume(period = AggregationPeriod.DAY);
def Current_Vol = volume;
def VolAvg = Average(volume, 10);
def VolAvg2 = Average(volume, 20);
def VolAvg3 = Average(volume, 50);


def mid_vol = (
if VolAvg > VolAvg2 and VolAvg < VolAvg3 then VolAvg else
if VolAvg < VolAvg2 and VolAvg > VolAvg3 then VolAvg else

if VolAvg2 > VolAvg3 and VolAvg2 < VolAvg then VolAvg2 else
if VolAvg2 < VolAvg3 and VolAvg2 > VolAvg then VolAvg2 else

if VolAvg3 > VolAvg2 and VolAvg3 < VolAvg then VolAvg3 else
if VolAvg3 < VolAvg2 and VolAvg3 > VolAvg then VolAvg3 else volavg2 );

def vf = (mid_vol * (RegularTradingEnd(GetYYYYMMDD()) - GetTime()) / GetAggregationPeriod()) + Daily_Total_Vol;

def percent = (Daily_Total_Vol)/vf;

AddLabel (yes, "VF: " +  vf  , Color.YELLOW);

AddLabel (yes, "Volume So Far: " + Daily_Total_Vol , Color.GREEN);

AddLabel (yes, "% of VF: " + round(percent*100,0) , Color.GRAY);
Why not use aggregation period of DAY to calculate vs daily on each timeframe? For people that use MTF it seems more useful
 
Why not use aggregation period of DAY to calculate vs daily on each timeframe? For people that use MTF it seems more useful
you stated "Why not use aggregation period of DAY to calculate vs daily "

if you use the period of day for aggregation to compare a daily then you cant calculate intraday because TOS doesn't allow you to aggregate from day to reference intraday data.
 
you stated "Why not use aggregation period of DAY to calculate vs daily "

if you use the period of day for aggregation to compare a daily then you cant calculate intraday because TOS doesn't allow you to aggregate from day to reference intraday data.
Unless I don’t understand what you’re saying, TOS definitely lets you aggregate from the day timeframe on intraday charts. I have a label with the running total volume on my intraday chart. It doesn’t matter what time frame I use.

If what you're saying is you can't say compare the volume of a 5min bar vs. the daily volume, OK, but why would you want to do that?

The following code shows the daily volume so far on any intraday chart, it doesn't matter what timeframe you're on:
AddLabel(yes, Concat("Daily Volume: ", volume(period = AggregationPeriod.DAY)), Color.GRAY);

Volume forecast should be comparing this daily volume vs. the average daily volume going back x number of days.
 
Last edited:
Unless I don’t understand what you’re saying, TOS definitely lets you aggregate from the day timeframe on intraday charts. I have a label with the running total volume on my intraday chart. It doesn’t matter what time frame I use.

If what you're saying is you can't say compare the volume of a 5min bar vs. the daily volume, OK, but why would you want to do that?

The following code shows the daily volume so far on any intraday chart, it doesn't matter what timeframe you're on:
AddLabel(yes, Concat("Daily Volume: ", volume(period = AggregationPeriod.DAY)), Color.GRAY);

Volume forecast should be comparing this daily volume vs. the average daily volume going back x number of days.

you said
"If what you're saying is you can't say compare the volume of a 5min bar vs. the daily volume, OK, but why would you want to do that"
"Volume forecast should be comparing this daily volume vs. the average daily volume going back x number of days."

i suppose you mis understood the title of the thread and the OP's request, i suggest you go back and read it and follow the thread a bit. To my understanding and from what the OP posted it appeared that he did want to compare the intraday data. (keep in mind the OP didnt want the current day Volume compared to avg daily volume as he indicated in post #4 ) If you have another method with your theory that can do what the OP requested with somewhat accurate results please do post.

what i was trying to say with the aggregation is once you aggregate to Day there are some limitations, actuall screenshot from TD may explain better.

Capture.jpg
 
Last edited by a moderator:
Almost seems like you were trying to hype a product from the way you sounded like you had it but didn't have it.. aside from that point ..
since the title of this is "volume forecast" here is my version of it, obviously it wont be the same as yours since the formula is different. As others in the thread have stated, it seems more like hype that anything else, but here goes the code for whoever can find it useful.

Note: Every timeframe will be different as it "forecasts" by the closest volume bars. If you want it relative to the Daily then use the day, if you want it relative to the minute then use the minute, if you want it relative to 30 mins, then use 30 mins and so on. It "Forecasts" till the closing bell, will not factor in afterhours.

sKQu40y.png


Code:
#Volume ForeCast v1.0 by XeoNoX via usethinkscript.com
#Note: Every timeframe will be different as it "forecasts" by the closest volume.
# If you want it relative to the Daily then use the day, if you want it relative to the minute then use the minute, if you want it relative to 30 mins, then use 30 mins and so on.
# It "Forecasts" till the closing bell, will not factor in afterhours.

def Daily_Total_Vol = volume(period = AggregationPeriod.DAY);
def Current_Vol = volume;
def VolAvg = Average(volume, 10);
def VolAvg2 = Average(volume, 20);
def VolAvg3 = Average(volume, 50);


def mid_vol = (
if VolAvg > VolAvg2 and VolAvg < VolAvg3 then VolAvg else
if VolAvg < VolAvg2 and VolAvg > VolAvg3 then VolAvg else

if VolAvg2 > VolAvg3 and VolAvg2 < VolAvg then VolAvg2 else
if VolAvg2 < VolAvg3 and VolAvg2 > VolAvg then VolAvg2 else

if VolAvg3 > VolAvg2 and VolAvg3 < VolAvg then VolAvg3 else
if VolAvg3 < VolAvg2 and VolAvg3 > VolAvg then VolAvg3 else volavg2 );

def vf = (mid_vol * (RegularTradingEnd(GetYYYYMMDD()) - GetTime()) / GetAggregationPeriod()) + Daily_Total_Vol;

def percent = (Daily_Total_Vol)/vf;

AddLabel (yes, "VF: " +  vf  , Color.YELLOW);

AddLabel (yes, "Volume So Far: " + Daily_Total_Vol , Color.GREEN);

AddLabel (yes, "% of VF: " + round(percent*100,0) , Color.GRAY);

Really enjoying this study, thanks for sharing. Something I noticed (maybe because I already have many studies running) is that this study seems to significantly increase the CPU load when used on a 1min chart, which is the time frame that I trade. I tried making a simple modification like this:

Code:
def Daily_Total_Vol = volume(period = AggregationPeriod.DAY);
def Current_Vol = volume(period = AggregationPeriod.fifteen_min);
def VolAvg = Average(volume(period = AggregationPeriod.fifteen_min), 10);
def VolAvg2 = Average(volume(period = AggregationPeriod.fifteen_min), 20);
def VolAvg3 = Average(volume(period = AggregationPeriod.fifteen_min), 50);

My hope was that this would cause the study to continue working, just as if it was running on a 15min chart, but decrease the number of CPU cycles used to run it by increasing the aggregation period used for forecasting, so that using the study doesn't cause as much chart lag.

Unfortunately, the above modification didn't work (it resulted in the volume forecast becoming negative and not making sense).

Is it possible to modify the study so that it can use a higher aggregation period on a lower time frame, to be less CPU intensive?
 
@lmk99 Your question is probably best answered by TDAmeritrade support

I've never gotten TD's support to provide assistance with Thinkscript coding issues. I think that it's just a coding challenge: to express the logic in a way that allows the aggregation period to be selectable, while still maintaining the code's functionality. Maybe it's worth making a new thread to ask if anyone has ideas for how to approach doing that for this particular study.
 
@lmk99 I don't believe what you are looking for is possible. Also, the type of technical support required to understand CPU loads is outside the purview of the uTs forum. While TDAmeritrade does not monitor TOS chat lounge there are others there who may be able to give you direction.
 
This doesn't make sense to me. How is $DWAC today showing a VF of 515M shares at the time of this post on 33M pre-market volume? Shoudln't the VF be fixed?
 
This doesn't make sense to me. How is $DWAC today showing a VF of 515M shares at the time of this post on 33M pre-market volume? Shoudln't the VF be fixed?
No the forecast is the exact opposite of fixed, if you look through the code, its constantly running a series of evaluations vs historical avgs vs the current inflow of volume. It fluctuates throughout the day to show you the in the moment in flow of volume. The point is to track it into the first hour or more of the day to build a thesis on whether or not today could potentially be an outlier volume type of day. this is especially needed for short sellers who may be fighting the front side. Or for someone going head long into over head volume resistance from a previous high volume day, the forecast provides you with somewhat of a barometer on the day and an idea for whether or not your thesis long or short could pan out given you exceed previous high volume days, or underachieve. aka Volume breakout, or all day fade vs historical overhead volume resistance. I check mine every 15 min. and in tradingview have built a table that gives me my % every 15 min and how were tracking on the day. Its a strong tool when used correctly in the right circumstance.
 
This Indicator appears to not provide accurate data. It cannot be recommended for use.
This thread has been locked
 
Status
Not open for further replies.

Similar threads

Not the exact question you're looking for?

Start a new thread and receive assistance from our community.

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