RVOL (Relative Volume) Scan Label Watchlist for ThinkorSwim

Correct me if I'm wrong but the GetDay(); function returns the current day of the year from 1 to 365. It doesn't count back bars from the current day with the current day holding [0].

Therefore RVol isn't correct.

Has anyone actually posted a functional and properly calculated RVol?
@Slippage, Can you please look into this issue? I wish I could answer but I know my coding level is not good enough to solve this.
 
@Slippage, Can you please look into this issue? I wish I could answer but I know my coding level is not good enough to solve this.
@Slippage hasn't checked in lately. Meanwhile, while I don't use relative volume and haven't been following this discussion. It would seem that there are several variations in this thread, starting w/ the three in the first post, do any of them do what you want?
 
Some ideas I have come across for using the RVOL indicator are using it to determine if the stock is even in play and how much to size your trade.
https://www.smbtraining.com/blog/relative-volume-rvol-defined-and-how-we-use-it

One of the indicators I have been interested in finding or developing in ToS is the Zanger Volume Ratio. It is similar to RVOL but tracks the increase/decrease of the volume throughout the time frame and also compares current volume to expected EOD volume.
https://www.traderslog.com/using-volume
Hi DeusMecanicus,

Were you able to find RVOL indicator based on SMB's definition?
 
Hi DeusMecanicus,

Were you able to find RVOL indicator based on SMB's definition?
Did you know that clicking on a member's avatar will allow you to see when a member was last seen on the uTS forum?
  • @DeusMecanicus has not been seen in a while. :(
  • The Zanger is not available in ThinkScript
 
The question is still open. How to set alert to trigger when the volume hit the line (numDev=2) ? Anybody has an answer? Would be appreciated!
 
would like to modify this script. this script compares yesterdays premarket volume with today's volume rvol
I would like it to compare today's premarket volume to last 20 days premarket volume with the same % and color schemes.


input Start = 0400;
input End = 0929;
input ShowTodayOnly = yes;
def Today = if GetDay() == GetLastDay() then 1 else 0;

def VolumeFromStart = SecondsFromTime(Start) >= 0 and SecondsTillTime(End) > 0;
def VolumeAtEnd = SecondsFromTime(End) >= 0;
def VolumeRange = VolumeFromStart and !VolumeFromStart[1];
def VolumeInRange = if VolumeRange then volume else if VolumeFromStart then VolumeInRange[1] + volume else VolumeInRange[1];
def V = (VolumeAtEnd + VolumeInRange);
def Cumulativevolume = if VolumeFromStart then VolumeInRange else Cumulativevolume[1];

def PreviousDayPreMarketVolume = if ShowTodayOnly and !Today then Cumulativevolume[1] else PreviousDayPreMarketVolume[1];

plot PreMarketVolume = Cumulativevolume;

def PercentChange = (((V - PreviousDayPreMarketVolume) / PreviousDayPreMarketVolume)) * 100;

AddLabel(Start, + Round(PercentChange));

AssignBackgroundColor(
if PercentChange > 0 then Color.Green else
if PercentChange < 0 then Color.Red else
if PercentChange == 0 then color.WHITE else Color.Gray);
 
Hey guys. I've been scouring the internet for an RVOL (Relative Volume) indicator for Thinkorswim but can't find a free one. Really need RVOL to be able to execute my trading plan.

I need something like what's posted in the attached image. If you do find one, I would need assistance installing it/setting it up as a watchlist as well.

Thanks a lot!

wrvkETD.png


Edit: Thank you to everyone for helping me. Below is a few different RVOL indicators for ThinkorSwim.

Version 1: https://usethinkscript.com/threads/...ator-watchlist-for-thinkorswim.1014/post-8511

Version 2: I believe shared by @Sonny

Code:
def isRollover = GetYYYYMMDD() != GetYYYYMMDD()[1];
def beforeStart = GetTime() < RegularTradingStart(GetYYYYMMDD());
def vol = if isRollover and beforeStart then volume else if beforeStart then vol[1] + volume else Double.NaN;
def PMV = if IsNaN(vol) then PMV[1] else vol;
def AV = AggregationPeriod.DAY;
def x = Average(Volume(period=AV)[1],60);
def y1 = Round((PMV/x),2);
def L = Lg(y1);
def p = if L>=1 then 0 else if L>=0 then 1 else 2;
def y2 = Round(y1,p);
plot z = y2;
z.assignValueColor(if z>=10 then color.CYAN else if z>=1 then createcolor(255,153,153) else createcolor(0,215,0));

Version 3: https://usethinkscript.com/threads/...gy-and-momentum-scanner-for-thinkorswim.3002/

Continue to read throughout this post and you'll find more variations of relative volume indicators. Good luck!
I'm using the version 2 code above in a watchlist column and am getting numbers between 0 and 2 which is fine but when I look at actual volumes on the daily chart it doesn't seem to jive with another indicator I have. How are we supposed to interpret these numbers? Does a 2 mean the daily volume is 2x the daily volume of the last X periods? As an example, I am seeing DVA's daily volume for today is just a bit greater than the average of the last 60 days (based on another indicator) yet the number in the watchlist column is 0.62 which makes me think it's roughly half of the last 50 days...
 
I'm using the version 2 code above in a watchlist column and am getting numbers between 0 and 2 which is fine but when I look at actual volumes on the daily chart it doesn't seem to jive with another indicator I have. How are we supposed to interpret these numbers? Does a 2 mean the daily volume is 2x the daily volume of the last X periods? As an example, I am seeing DVA's daily volume for today is just a bit greater than the average of the last 60 days (based on another indicator) yet the number in the watchlist column is 0.62 which makes me think it's roughly half of the last 50 days...
This is showing the volume for specified time period, did you try changing the time variables to 9:30-16:00?
 
wanted to see if anyone knew how to add alerts to this default TOS script Called relativevolumestdev listed below? looking for getting alerted when purple vol shows.

#
# TD Ameritrade IP Company, Inc. (c) 2014-2022
#

declare lower;
declare zerobase;

input length = 60;
input numDev = 2.0;
input allowNegativeValues = no;

def rawRelVol = (volume - Average(volume, length)) / StDev(volume, length);
plot RelVol = if allowNegativeValues then rawRelVol else Max(0, rawRelVol);
plot StDevLevel = numDev;

RelVol.SetPaintingStrategy(PaintingStrategy.HISTOGRAM);
RelVol.SetLineWeight(3);
RelVol.DefineColor("Above", GetColor(0));
RelVol.DefineColor("Below", GetColor(2));
RelVol.AssignValueColor(if RelVol >= numDev then RelVol.Color("Above") else RelVol.Color("Below"));
StDevLevel.SetDefaultColor(GetColor(7));
StDevLevel.SetStyle(Curve.SHORT_DASH);

2022-05-16-FLEXIBLE-GRID.png


I know there are people that can code this easy 🙏
 
Last edited by a moderator:
Called relativevolumestdev
Go to your scan tab and create a new scan. Add filter and your RelativeStDev study. Edit the Study to one of these scan settings (greater than 2 [or whatever your cross point is], or might suggest crosses above 2 within 3 bars [so stays on your scanner after the cross for 3 periods]), then set the aggregation period to same as your chart (3 min, 15 min, whatever you use). Add other filters to whittle down the tickers as needed. Then run the scan to verify, then save the scan as watchlist. Be sure to select the option to alert with changes if you want to get alerts with new names.

Load the watchlist on your widgets area and you'll have a continual list of stocks that are crossing (or greater than) your level. Pictures below:
If you don't know have to create a scan or watchlist, there are videos on youtube in the usethinkscript channel. Good Luck!
 
Last edited:
Merry, Can you help me to convert the below script in to scanner?

# rvol watchlist column
# by @huskytrader
# 10-31-2019

def volumeAvgPeriodDays = 30;
def volumeAvg = (fold index=1 to volumeAvgPeriodDays+1 with acc=1 do acc+volume(period="DAY")[index]) / volumeAvgPeriodDays;

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

plot a = Round((volumeToday / volumeAvg), 2);

AddLabel(yes, (a*100)+"%", Color.Black);

AssignBackgroundColor(if a > 1 then Color.MAGENTA else if a > 0.7 then Color.LIME else if a > 0.5 then Color.WHITE else Color.gray);
 
Merry, Can you help me to convert the below script in to scanner?

# rvol watchlist column
# by @huskytrader
# 10-31-2019

def volumeAvgPeriodDays = 30;
def volumeAvg = (fold index=1 to volumeAvgPeriodDays+1 with acc=1 do acc+volume(period="DAY")[index]) / volumeAvgPeriodDays;

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

plot a = Round((volumeToday / volumeAvg), 2);

AddLabel(yes, (a*100)+"%", Color.Black);

AssignBackgroundColor(if a > 1 then Color.MAGENTA else if a > 0.7 then Color.LIME else if a > 0.5 then Color.WHITE else Color.gray);
Yes, this script works in the scanner.
The filters are:
a > 1 # for Color.MAGENTA
a > 0.7 and a < 1 #for Color.LIME
a > 0.5 and a < .7 #for Color.WHITE
https://usethinkscript.com/threads/how-to-use-thinkorswim-stock-hacker-scans.284/
 
Last edited:
The study @BenTen posted on this thread used an AssignPriceColor() statement that would be applicable in charts.

Here's a relative volume for the watchlist I have been using. It is color coded so if the watchlist column is colored LIGHT_GREEN that flags a high relative volume day. Otherwise a PINK color on the watchlist column would indicate regular/moderate relative volume day

Code:
# START
plot c = Volume(period = AggregationPeriod.DAY) / Average(volume(period = AggregationPeriod.DAY), 20);
c.SetDefaultColor(Color.BLACK);
AssignBackgroundColor(if c > 5 then Color.LIGHT_GREEN else Color.PINK);
# END
I wonder if there is a way to get the symbol column- to have the background color that matches the RVOL color schemes?
 
I am trying to add a scanner to my watchlist which shows the Relative Volume , I used the below code but I always get the Relative Volume"rVol" value as 1 , I found that VolumeAvg and volume always give the same number which it should not be the case . any help is appreciated . am checking the Daily volume.

The Code :

def length = 50;
def rVol = (volume / VolumeAvg(length));


addlabel(yes,rvol);



AL3ixs8.jpg
 

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