Volume Labels For ThinkOrSwim

rnephosCloudMam

New member
VIP
I ran across some thinkScript label that has helped me see comparative volumes at a glance.

y1wc1JG.png

On my charts I have them in the Lower Charts (where I use the Ultimate_Volume_Indicator). I don't know who wrote the script. It wasn't in the notes. My contribution was adding a calculation to give the percent calculation showing percent of this day's volume to the average daily volume AND the percent of time elapsed through the day in hours.

The Code:

Code:
Input ShowTotalVolume = yes;
Input ShowCurrentBarVolume = yes;
Input ShowPreviousBarVolume = yes;
Input ShowDaysAverageVolume = yes;
Input DaysAverage = 50;

### TOTAL VOLUME ###
AddLabel (ShowTotalVolume, "Total Volume: " + volume(period = aggregationperiod.DAY), color.WHITE);

### PERCENT CURRENT VOLUME TO DAYS AVERAGE VOLUME by CloudMan ###
def PercentVol = volume(period = aggregationperiod.DAY)/average(volume(period = aggregationperiod.day),DaysAverage);
def rth = ((GetTime() - RegularTradingStart(GetYYYYMMDD())) / AggregationPeriod.HOUR)/6.5;
AddLabel (yes, "V: " + AsPercent (PercentVol) + " T: " + AsPercent (rth), color.CYAN);

### DAYS AVERAGE VOLUME ###
AddLabel (ShowDaysAverageVolume, DaysAverage + "DAvg: " + average(volume(period = aggregationperiod.day),DaysAverage), color.light_gray);



### CURRENT BAR VOLUME ###
AddLabel (ShowCurrentBarVolume, "CurBar Volume: " + volume, if volume > volume[1] then color.green else color.red);

### PREVIOUS BAR VOLUME ###
AddLabel (ShowPreviousBarVolume, "PrevBar Volume: " + volume[1], color.orange);
 

Attachments

  • Screenshot 2025-09-08 130716.png
    Screenshot 2025-09-08 130716.png
    33.6 KB · Views: 42
Last edited by a moderator:

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

I love my new volume percentage label so I decided to write a custom scan using that info to find stocks that are trading above relative volume for the day. Everything seemed to be working great except for the last calculation. You will notice that if I plug the number, the scan works perfectly. But when I try to use the GetTime() and RegularTradingStart() formulas, it doesn't work correctly. But the calculation for the label is correct. Am I missing something? @BenTen @antwerks @TRADERSAM
 

Attachments

  • Screenshot 2025-09-09 135056.png
    Screenshot 2025-09-09 135056.png
    47.6 KB · Views: 24
  • Screenshot 2025-09-09 135120.png
    Screenshot 2025-09-09 135120.png
    219.8 KB · Views: 26
Last edited:
To add some more context ... I used the "#" to deactivate certain lines of code while I was testing my error. I want to use the line that has the # and delete the following line but it isn't working. I assume there is something I am missing about the data coming from GetTime. I wish there were a way I could just test the mathematical return of a line of code.
 

Not the exact question you're looking for?

Start a new thread and receive assistance from our community.

87k+ Posts
745 Online
Create Post

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