Premarket volume on watchlist

uhtcoh

New member
Hello lovely people,

I am looking for some help with a think or swim script.

My goal is to display premarket volume as a sum total, only between 8:00-9:29 AM EST (i.e. premarket, but not including 4 am-8 am), for stocks in my watchlist (aapl, googl, bidu, for example). I do not need this displayed on any chart for now, just as a custom column in the watchlist.

I'm using this code below, but the values displayed end in E7, E8, E9, or E10 i.e. big numbers. Is it because TOS is showing shadow volume not normally displayed? I read that on another thread for a different topic, so maybe it's a real thing.

--
input startTime = 0800;
input endTime = 0929;
def startCounter = SecondsFromTime(startTime);
def endCounter = SecondsTillTime(endTime);
def targetPeriod = if startCounter >= 0 and endCounter >= 0 then 1 else 0;

# This is the cumulative volume for the current day
def totalVolume = if targetPeriod and !targetPeriod[1] then volume
else if targetPeriod then totalVolume[1] + volume
else totalVolume[1];

plot signal = totalVolume;
--

Also, the volume keeps updating. It's now past 9:30 AM EST when I check, so I know I'm not seeing exactly what I want since volume should stop updating after 9:29 AM. Is this a limitation of TOS software, that volume can't be summed only for a specific timeframe? Or, volume calculations constantly update and can't be "time locked" (stop calculating after a specific time of day)?

If what I'm looking for is not available in TOS, any other ideas how I can get at this information quickly? Premarket volume between specific hours. An example of the output I'm looking for:

Ticker
Sum of volume (8 - 9:29 AM EST) for current day

aapl
45,323

bidu
223,322

Thank you in advance for your help.

Tristan
 
Solution
Hello lovely people,

I am looking for some help with a think or swim script.

My goal is to display premarket volume as a sum total, only between 8:00-9:29 AM EST (i.e. premarket, but not including 4 am-8 am), for stocks in my watchlist (aapl, googl, bidu, for example). I do not need this displayed on any chart for now, just as a custom column in the watchlist.

I'm using this code below, but the values displayed end in E7, E8, E9, or E10 i.e. big numbers. Is it because TOS is showing shadow volume not normally displayed? I read that on another thread for a different topic, so maybe it's a real thing.

--
input startTime = 0800;
input endTime = 0929;
def startCounter = SecondsFromTime(startTime);
def endCounter =...
Hello lovely people,

I am looking for some help with a think or swim script.

My goal is to display premarket volume as a sum total, only between 8:00-9:29 AM EST (i.e. premarket, but not including 4 am-8 am), for stocks in my watchlist (aapl, googl, bidu, for example). I do not need this displayed on any chart for now, just as a custom column in the watchlist.

I'm using this code below, but the values displayed end in E7, E8, E9, or E10 i.e. big numbers. Is it because TOS is showing shadow volume not normally displayed? I read that on another thread for a different topic, so maybe it's a real thing.

--
input startTime = 0800;
input endTime = 0929;
def startCounter = SecondsFromTime(startTime);
def endCounter = SecondsTillTime(endTime);
def targetPeriod = if startCounter >= 0 and endCounter >= 0 then 1 else 0;

# This is the cumulative volume for the current day
def totalVolume = if targetPeriod and !targetPeriod[1] then volume
else if targetPeriod then totalVolume[1] + volume
else totalVolume[1];

plot signal = totalVolume;
--

Also, the volume keeps updating. It's now past 9:30 AM EST when I check, so I know I'm not seeing exactly what I want since volume should stop updating after 9:29 AM. Is this a limitation of TOS software, that volume can't be summed only for a specific timeframe? Or, volume calculations constantly update and can't be "time locked" (stop calculating after a specific time of day)?

If what I'm looking for is not available in TOS, any other ideas how I can get at this information quickly? Premarket volume between specific hours. An example of the output I'm looking for:

not sure why the big numbers. it looks ok.
you are resetting the volume each day, and it seemed to work for me.

i changed it a little,
. forced a reset to 0 on each day
. divided the volume by 1000 so the numbers will be smaller, in thousands


column study

zvolpre1
http://tos.mx/!dlF0UyM2


Code:
#vol_pre_partial_daily

#https://usethinkscript.com/threads/premarket-volume-on-watchlist.18754/
#Premarket volume on watchlist
#display premarket volume as a sum total, only between 8:00-9:29 AM EST (i.e. premarket, 

input startTime = 0800;
input endTime = 0930;
def startCounter = SecondsFromTime(startTime);
def endCounter = SecondsTillTime(endTime);
def targetPeriod = if startCounter >= 0 and endCounter > 0 then 1 else 0;

def f = 1000;
# This is the cumulative volume for the current day
def totalVolume = if targetPeriod and !targetPeriod[1] then volume/f
 else if startCounter < 0 then 0
 else if targetPeriod then totalVolume[1] + volume/f
 else totalVolume[1];

plot signal = totalVolume;
#


--------


here is a lower study for testing

Code:
#vol_pre_partial_daily

#https://usethinkscript.com/threads/premarket-volume-on-watchlist.18754/
#Premarket volume on watchlist
#uhtcoh  5/29
#My goal is to display premarket volume as a sum total, only between 8:00-9:29 AM EST (i.e. premarket, 

declare lower;

input startTime = 0800;
input endTime = 0930;
def startCounter = SecondsFromTime(startTime);
def endCounter = SecondsTillTime(endTime);
def targetPeriod = if startCounter >= 0 and endCounter > 0 then 1 else 0;

def f = 1000;
# This is the cumulative volume for the current day
def totalVolume = if targetPeriod and !targetPeriod[1] then volume/f
 else if startCounter < 0 then 0
 else if targetPeriod then totalVolume[1] + volume/f
 else totalVolume[1];

plot signal = totalVolume;

#
 

Attachments

  • lower.JPG
    lower.JPG
    34.2 KB · Views: 68
Solution

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
513 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