# Daily Volume Percentage (watchlist) Column for PreMarket

#### mattastic1

##### New member
Hi fellas - For my trading plan, I tend to look at the Average volume for 60days and compare that number with today's volume every morning (During Pre-Market hours) to come up with a list of stocks of interest to trade.

I figured maybe now is a good time to create a volume percentage column on the watchlist to quickly see what's moving in my list of stocks.

to recap idea is:
• see a percentage of today's volume in comparison to the last 60days
• if today's premarket volume is greater than 10% I'm interested and would like to see that as a Green percentage value!! (see red color)
• place the "%" sign at the end as well for each value

Here is what I have so far

Code:
``````def avgVol = Average(volume, 60);

def today = volume(period = "DAY");

plot VolumePercentage = Round((today / avgVol) * 100, 0);

VolumePercentage.assignvalueColor(if VolumePercentage >10 then color.green else color.red);``````

something is off...it's not displaying the data I'm looking for... any tweaks above? Thanks again!

Solution
With different aggregations your volume is still added through the day (1 day, 1 hour, 5 min etc). Meaning in the watchlist column the volume continues to increase even through regular market trading hours. My guess is you will need a defined range of data for the premarket as an example 400 am to 929 am time frame. There is a premarket code here

plot Data = close;#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]...
With different aggregations your volume is still added through the day (1 day, 1 hour, 5 min etc). Meaning in the watchlist column the volume continues to increase even through regular market trading hours. My guess is you will need a defined range of data for the premarket as an example 400 am to 929 am time frame. There is a premarket code here

plot Data = close;#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];

I'm trying to get the percent of premarket volume compared to the prior day's volume. For some odd reason, I can't get the code above to work at all. The volume is never premarket as it's much larger than even the prior day's volume.

87k+ Posts
310 Online

## The Market Trading Game Changer

Join 2,500+ subscribers inside the useThinkScript VIP Membership Club
• Exclusive indicators
• Proven strategies & setups
• Private Discord community
• Exclusive members-only content
• 1 full year of unlimited support

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?