RVOL (Relative Volume) Scan Label Watchlist for ThinkorSwim

Hello Gurus, , I would like to show the RVOL in the chart itself (upper left) instead of as a column in the watch list. A
 
Last edited by a moderator:
Hello Gurus, , I would like to show the RVOL in the chart itself (upper left) instead of as a column in the watch list. Actually I would like to see some BASIC info for the ticker on the upper left corner of the chart such as these - RVOL, Market cap, Shares etc. I really really appreciate your help. Thanks

If 3min chart, use bpd = 130, 5min chart bpd = 78, 10min chart def bpd = 39.

Code:
input STime = 0930 ; #hint STime: Start of normal trading hours
input ETime = 1600 ; #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);
 
@ezrollin Thanks Ez, i would like to have one decimal only ,instead on 4 or 5(ex. 4.2 instead of 4.2341)

@tomsk Thank You, very much appreciated. That's very nice of you, love this place.

My Final Adjustments with you guys helping, thanks to all. Shows RVOL, different colors based on values.

Code:
plot c = Volume(period = AggregationPeriod.DAY) / Average(volume(period = AggregationPeriod.DAY), 20);
c.SetDefaultColor(Color.BLACK);
AssignBackgroundColor(if c > 7 then Color.Dark_Green
                      else if c > 5 then Color.Green
                      else if c > 3 then Color.Orange
                      else if c > 2 then Color.Pink
                      else Color.red);
AddLabel(yes, AsText(c, NumberFormat.TWO_DECIMAL_PLACES) + "X", Color.Black);

Asking for help one more time, any help will be awesome. It works with volume instead of shares, but i want shares (as millions)

plot x = (shares);
AddLabel (yes, + Round(x * .000001, 1) + "M", Color.yellow);

4x15n3E.png
Hi, could you please share the RVol indicator (watchlist) you have based on the volume? What aggregation period we should use for the RVol watchlist column?
Thanks a lot.
 
@Patrick_Hu Here is the RVOL watchlist column. Set it to Daily.

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));
 
@cbucks Probably not unless ToS allows you to add load custom watchlist column on their app.
 
@stockscouter87 Here is the RVOL watchlist column that @Sonny shared:

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));
 
@BenTen and where exactly do i plug that in at? under study or scan? i tried doing it in watchlist but that def does not look correct
 
Last edited by a moderator:
I'm trying to use this as a chart study. Right now my whole chart changes color when I use it. Does anyone know what I would need to change to make just the indicator change color?

Code:
plot c = Volume(period = AggregationPeriod.DAY) / Average(volume(period = AggregationPeriod.DAY), 63);
c.SetDefaultColor(Color.BLACK);
AssignBackgroundColor(if c > 20 then Color.BLUE
else if c > 10 then Color.DARK_GREEN
else if c > 8 then Color.GREEN
else if c > 6 then Color.LIGHT_GREEN
else if c > 4 then Color.LIME
else if c > 2 then Color.YELLOW
else if c > 1 then Color.PINK
else if c < 1 then Color.RED else Color.LIGHT_GRAY);
AddLabel(yes, AsText(c, NumberFormat.TWO_DECIMAL_PLACES) + "x", Color.Black);
 
@zwedle AssignBackgroundColor() is your culprit... It is being used in the wrong context... Try using c.AssignValueColor() instead...
 
@JonR

input ETime = 1530

any reason why you never put 1600 for end time ?
I was reading this forum and I figured since I hadn't seen anyone respond to this, I might try.
I believe it's because, with volume-based studies, the open and close have abnormally high relative volume, which might skew the results, that's my thought.
 
Hello,

I need some help coding my modified RVOL indicator. The goal of my code is to take the data of the current day up to a certain period of time (for ex 10 AM EST) and compare it (find the ratio essentially) to the average of the data for the last 20 days up to that same period of time (still 10EST). So far I have

Code:
declare lower;
declare zerobase;

input length = 50;

def currentVol = currentVol[1] + volume;
def avgVol = [I]Need help to find avg of last 20 days[/I]
plot currentVol / avgVol;

Any help would be appreciated

Thanks
 
@shreyb Change your current length to 20 and use the snippet below:

Code:
def Vol = volume;
def VolAvg = Average(volume, length);
 
however, this gives the RVOL for the total day. What im trying to do is compare the RVOL up to a certain period of time. For ex if its 10 EST, I would want to compare the volume from 9:30-10 to the avg volume from 9:30-10:00 for the last 20 days.
 
BenTen,

How are you?

I try both codescripts for RELATIVE VOLUME FOR WATCH LIST COLUMN.
why do i get two different results?

Codscrip number 1

Code:
input length = 21;
input offset = 1;

def ADV = Average(volume, length)[offset];
def rVol = volume /ADV;

# remove "#" infront of Addlabels to select prefer choice

AddLabel(yes, round(rVol,2));
#AddLabel(yes, asPercent(rVol));

AssignPriceColor(if rVol >= 1 then color.dark_red else if rVol <=.5 then Color.black else color.Gray);

Codescriot number 2

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));
 

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