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);
AddLabel(yes, Round(avgVol, 0));


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];
AddLabel(yes, Concat("PMV: ", volumeTotal), Color.VIOLET);
 
Solution

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

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.
 

Similar threads

Not the exact question you're looking for?

Start a new thread and receive assistance from our community.

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