RVOL (Relative Volume) Scan Label Watchlist for ThinkorSwim

I have the RVOL code on chart that plots arrows when high RVOL is registered and I could do a scan but thru the day, RVOL will drop off

wanting it for today only and either on 1hr or 10 min bars

RVOL = > 2 within x bars (but only want for the current day)

Thanks for any help
 

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

I have the RVOL code on chart that plots arrows when high RVOL is registered and I could do a scan but thru the day, RVOL will drop off

wanting it for today only and either on 1hr or 10 min bars

RVOL = > 2 within x bars (but only want for the current day)

Thanks for any help

Forgive me if I'm missing something, or several things, here as it's going on 6am in my time zone and I'm way overdue for sleep.

First, I'm missing why you think RVOL will drop off through the day? Though it represents volume at this time of day compared to the average at this time of day, it's not resetting every candle. It's the cumulative volume at that time of day compared to the average of cumulative volume at that time of day. For instance, for today's session, in the pre-market I selected LYFT for my watchlist. The day is over and LYFT's RVOL is 4.74. It likely never was near the average.

If volume would fall off so much that RVOL is moving back to the average it means everyone lost interest except you. It means the current/recent volume at that time of day is lower than the average day. Do you still want to trade it? Some kind of fade play? If yes, okay this is the case where you would need within x bars. If you don't need within x bars then your scan is simple and you don't have to worry about only the current day because you'll only be scanning the current bar.

If these points haven't eliminated your desire for within x bars but only today...

To avoid looking back to the previous day I think you'd have to give up the within x bars syntax and instead keep a count of the bars since open and use something like this...

Ruby:
def rvol = # your rvol code
def x = 5; # x as in `within x bars`
def barCount = if GetDay() != GetDay()[1] then 1 else barCount + 1;
plot scan = Highest(rvol, Min(x, barCount)) >= 2;

If your rvol script on your chart doesn't lend itself to this you can find other examples in this thread: https://usethinkscript.com/threads/rvol-relative-volume-indicator-watchlist-for-thinkorswim.1014/
 
Last edited:
Forgive me if I'm missing something, or several things, here as it's going on 6am in my time zone and I'm way overdue for sleep.

First, I'm missing why you think RVOL will drop off through the day? Though it represents volume at this time of day compared to the average at this time of day, it's not resetting every candle. It's the cumulative volume at that time of day compared to the average of cumulative volume at that time of day. For instance, for today's session, in the pre-market I selected LYFT for my watchlist. The day is over and LYFT's RVOL is 4.74. It likely never was near the average.

If volume would fall off so much that RVOL is moving back to the average it means everyone lost interest except you. It means the current/recent volume at that time of day is lower than the average day. Do you still want to trade it? Some kind of fade play? If yes, okay this is the case where you would need within x bars. If you don't need within x bars then your scan is simple and you don't have to worry about only the current day because you'll only be scanning the current bar.

If these points haven't eliminated your desire for within x bars but only today...

To avoid looking back to the previous day I think you'd have to give up the within x bars syntax and instead keep a count of the bars since open and use something like this...

Ruby:
def rvol = # your rvol code
def x = 5; # x as in `within x bars`
def barCount = if GetDay() != GetDay()[1] then 1 else barCount + 1;
plot scan = Highest(rvol, Min(x, barCount)) >= 2;

If your rvol script on your chart doesn't lend itself to this you can find other examples in this thread: https://usethinkscript.com/threads/rvol-relative-volume-indicator-watchlist-for-thinkorswim.1014/


Like you I currently need sleep so 😳

I guess I wasn't saying rvol will fade...for instance the first 1 hr candle may have high rvol while the 2nd, etc may not

I think your code maybe what I'm looking for, which is looking for on the 1hr or ten minute, the first several bars of the current day, that have high rvol without flagging the previous days bars, if they also had high rvol

Hope that makes sense
 
It makes sense in terms of how to find those bars, if you need to, yes. The bar count coupled with using Min() on the length passed to Highest() or Lowest() or any other function you might want to use there will work.
 
Code:
input length = 21; #number of days
input offset = 1; #offset day: 1 = dont include today

def ADV = Average(volume, length)[offset]; #ADV
def rvol = volume /ADV; #Relative Volume


# remove '#' infront of ADDlabels to select prefer choice

AddLabel(yes, round(rVol,2)); #show in ratios
#AddLabel(yes, asPercent(rVol)); #show in percentage

I am trying to scan for RVOL > than 2.0 in the TOS scanner but cannot get this code to work when I use it as a custom study.

Anybody out there doing this??
 
@Whitejustin522

To plot rvol, change your code from:
def rvol = volume /ADV; #Relative Volume
to:
plot rvol = volume /ADV; #Relative Volume
OGuPHqi.png
 
Last edited:
Does this enable me to select stocks with RVOL > 2.0 only? I tried changing it to your suggestion and it accepted the script. However I don't think that my script has it truly searching for tickers with elevated RVOL.

is there a way to code to only show stocks with RVOL > 2??

I have seen RVOL chart indicators but I am hoping to find use RVOL as a parameter when scanning premarket

@Whitejustin522

To plot rvol, change your code from:
def rvol = volume /ADV; #Relative Volume
to:
plot rvol = volume /ADV; #Relative Volume
OGuPHqi.png
 
Last edited:
@Whitejustin522 You made the change shown in the above post to your study?
And then you scanned for rvol greater than 2? Did you click "ext" for extended market hours?
IiL0fKf.png

What problems are you having? Please explain in detail. Please post a screenshot of your scan.
 
@Whitejustin522 You made the change shown in the above post to your study?
And then you scanned for rvol greater than 2? Did you click "ext" for extended market hours?
IiL0fKf.png


This is what I did. I don't get to edit it as a condition after doing this though. I am assuming I wrote it wrong??

Thank you so much for your response!
What problems are you having? Please explain in detail. Please post a screenshot of your scan.
cbe6dd8db8e8ead2683f616e18b8d25ed683e542.png
 
Ruby:
input length = 21; #number of days
input offset = 1; #offset day: 1 = dont include today

def ADV = Average(volume, length)[offset]; #ADV
plot rvol = volume /ADV; #Relative Volume
Copy the above code
In TOS, in studies, click on Create
Paste the code
Save the study with the name: rvol
Click on scan.
Click on +Add filter
Click on the pencil icon next to the filter you just added
Click edit
Click on pull-down window, click add study
Type in rvol
In the middle column, choose Greater Than
In the right column, choose Value, change value from 100 to 2
for pre-market, make sure to check 'ext'
Save
U1DWdYO.png
 
Ruby:
input length = 21; #number of days
input offset = 1; #offset day: 1 = dont include today

def ADV = Average(volume, length)[offset]; #ADV
plot rvol = volume /ADV; #Relative Volume
Copy the above code
In TOS, in studies, click on Create
Paste the code
Save the study with the name: rvol
Click on scan.
Click on +Add filter
Click on the pencil icon next to the filter you just added
Click edit
Click on pull-down window, click add study
Type in rvol
In the middle column, choose Greater Than
In the right column, choose Value, change value from 100 to 2
for pre-market, make sure to check 'ext'
Save
U1DWdYO.png


Thank you very much I really appreciate it. I am new to this forum thing.
 
If 3min chart, use bpd = 130, 5min chart bpd = 78, 10min chart def bpd = 39.

Hi, thank you for the code. I'm trying to get the average first 30 minutes vol for the last 10 days.
So if I changed ETime to 1000, the cumVolumePrev should return what I want, right?
I added AddLabel(1, "Cum10D: " + Round(cumVolumePrev, 0), Color.YELLOW); to output the volume number and found out the value varies by changing the bpd number and chart time frame.
And no matter what I changed, it's way off from my manual calculation.
What do I missing here?

Code:
input STime = 0930 ; #hint STime: Start of normal trading hours
input ETime = 1000 ; #hint ETime: End of normal trading hours
input thold = 1.5 ; #hint told: Threshold for color break
#def bpd = 39 ; # 10mins Bars per day during active trading hours
def bpd = 78 ; # 5mins Bars per day during active trading hours
#def bpd = 130 ; # 3mins Bars per day during active trading hours
def daycnt = 10; # Number of days

def IsActive = if secondsTillTime(ETime) > 0 and
                     secondsFromTime(STime) >= 0
                  then 1
                  else 0;


# This is the cumulative volume for the current day between STime and ETime
def cumVolume = if IsActive and !IsActive[1]
    then volume[1]
    else if IsActive then cumVolume[1] + volume[1]
    else cumVolume[1];

# This is the average cumulative volume over the same time period from the previous 10 days
def cumVolumePrev = if IsActive and !IsActive[1]
    then (volume[(bpd*1)+1] + volume[(bpd*2)+1] + volume[(bpd*3)+1] + volume[(bpd*4)+1] + volume[(bpd*5)+1] + volume[(bpd*6)+1] + volume[(bpd*7)+1] + volume[(bpd*8)+1] + volume[(bpd*9)+1] + volume[(bpd*10)+1] ) / daycnt
    else if IsActive then cumVolumePrev[1] + (volume[(bpd*1)+1] + volume[(bpd*2)+1] + volume[(bpd*3)+1] + volume[(bpd*4)+1] + volume[(bpd*5)+1] + volume[(bpd*6)+1] + volume[(bpd*7)+1] + volume[(bpd*8)+1] + volume[(bpd*9)+1] + volume[(bpd*10)+1] ) / daycnt
    else cumVolumePrev[1];

plot RelVol = cumVolume / cumVolumePrev ;

AddLabel(yes, Concat("Rvol: ", Round(RelVol)),Color.YELLOW);
AddLabel(1, "Cum10D: " + Round(cumVolumePrev, 0),  Color.YELLOW);
 
Last edited:
Hey guys, I was wondering if anyone knows how Finviz's relative volume is calculated. If so, I would love for it to be displayed on TOS as a percentage. I trade breakouts with high volume for a higher probability trade so it would be nice if I could see this directly on my chart, rather than switch tabs and go to Finviz. Thanks
 
@luiscervantes30

Relative Volume (often times called RVOL) is an indicator that tells traders how current trading volume is compared to past trading volume over a given period. ... So if it is showing 3.5 relative volume, that means it is trading at 3.5 times its normal volume for that time period. -source
 
@minime Do you have Ext Hours turned on? That'll mess up finding the correct bars in the past because the Ext Hours causes a different number of candles to be displayed. It can't be adjusted for because you can't rely on the chart to display the same number of Ext Hours periods each day. If there's no activity there's no candle.
 
@minime Do you have Ext Hours turned on? That'll mess up finding the correct bars in the past because the Ext Hours causes a different number of candles to be displayed. It can't be adjusted for because you can't rely on the chart to display the same number of Ext Hours periods each day. If there's no activity there's no candle.
Hi, turn off the Ext Hours helps somewhat but still not accurate, I tested 4 tickers and 2 of them off within 1%, other 2 varies from 7% to 25%
How about the code for cumulated first 6 bars from the market open for the last 10 days in a 5 min chart? It should work the same as putting a time limit for the first 30 mins. Any idea how to write such code?
 
I do not unfortunately:( that was my first question, I was wondering if anyone on this forum has an idea
if you hover the mouse over finviz relative volume it will tell you the parameters they use, it just doesnt tell if you extended hours is calculated as well, but that would only take trial and error to find out.
 

Similar threads

Not the exact question you're looking for?

Start a new thread and receive assistance from our community.

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