RVOL Label

bargains730

New member
I am looking for a simple RVOL label for my charts. I do not need it for watchlist, I only need it to display on the top left of my charts.

The RVOL label I have found so far is the following code below, however, it does not match RVOL as shown in DAS Trader, Trade Ideas or TradingView.
example: my label using below code shows RVOL for PYPL today 4-30-2024 to be 1.89....whereas DAS shows it 560%, TradingView 290%, Tradeideas 7.18.

Is there anyway to edit this code below to make it closer to show a RVOL # that is closer to DAS?

I use this for day trading the first 45 mins of the day, therefore, I need to determine is RVOL is higher faster and it should be very obvious to me across different tickers I have on my screens, so I can easily spot which one is "in play"

Can anyone help adjust the RVOL code ?

Thank you!

1. I only need a chart label, not for watchlist
2. I only need 2 colors: YELLOW if RVOL < 1, GREEN if RVOL > 1
3. is it possible to increase font size of label?


input offset = 1;
def rVol = volume(period = AggregationPeriod.DAY) / Average(volume(period = AggregationPeriod.DAY), 126) [offset];
AddLabel(yes, Round(rVol, 2),if rVol > 10 then Color.BLUE
else if rVol > 8 then Color.DARK_GREEN
else if rVol > 6 then Color.GREEN
else if rVol > 4 then Color.LIGHT_GREEN
else if rVol > 2 then Color.LIME
else if rVol > 1 then Color.YELLOW
else if rVol < 1 then Color.PINK else Color.BLACK);
 
Solution
I am looking for a simple RVOL label for my charts. I do not need it for watchlist, I only need it to display on the top left of my charts.

The RVOL label I have found so far is the following code below, however, it does not match RVOL as shown in DAS Trader, Trade Ideas or TradingView.
example: my label using below code shows RVOL for PYPL today 4-30-2024 to be 1.89....whereas DAS shows it 560%, TradingView 290%, Tradeideas 7.18.

Is there anyway to edit this code below to make it closer to show a RVOL # that is closer to DAS?

I use this for day trading the first 45 mins of the day, therefore, I need to determine is RVOL is higher faster and it should be very obvious to me across different tickers I have on my screens, so I can...
I am looking for a simple RVOL label for my charts. I do not need it for watchlist, I only need it to display on the top left of my charts.

The RVOL label I have found so far is the following code below, however, it does not match RVOL as shown in DAS Trader, Trade Ideas or TradingView.
example: my label using below code shows RVOL for PYPL today 4-30-2024 to be 1.89....whereas DAS shows it 560%, TradingView 290%, Tradeideas 7.18.

Is there anyway to edit this code below to make it closer to show a RVOL # that is closer to DAS?

I use this for day trading the first 45 mins of the day, therefore, I need to determine is RVOL is higher faster and it should be very obvious to me across different tickers I have on my screens, so I can easily spot which one is "in play"

Can anyone help adjust the RVOL code ?

Thank you!

1. I only need a chart label, not for watchlist
2. I only need 2 colors: YELLOW if RVOL < 1, GREEN if RVOL > 1
3. is it possible to increase font size of label?


input offset = 1;
def rVol = volume(period = AggregationPeriod.DAY) / Average(volume(period = AggregationPeriod.DAY), 126) [offset];
AddLabel(yes, Round(rVol, 2),if rVol > 10 then Color.BLUE
else if rVol > 8 then Color.DARK_GREEN
else if rVol > 6 then Color.GREEN
else if rVol > 4 then Color.LIGHT_GREEN
else if rVol > 2 then Color.LIME
else if rVol > 1 then Color.YELLOW
else if rVol < 1 then Color.PINK else Color.BLACK);

TOS limits us to 2000 historical bars for calculations. I use a modified RVOL that is calculated using the maximum number of bars that Thinkorswim allows for a lookback period of 25 days. Charts don't allow multiple timeframe calculations therefore you would need to decide what timeframe chart you will be using and modify the code below to match it. Thats why I use this in a watchlist instead. I prefer to use a 1 or 2-minute chart however a 1 or 2-minute RVOL moves around too much for me. I found that a 5-minute aggregation results in a better, more filtered, RVOL than a 1 or 2-minute. I keep my watchlist set to 5min. I scan for stocks trading over 1M shares and then sort the resulting watchlist by RVOL in order to find in-play stocks.
If you want to use this on a lower timeframe such as a 2-minute chart you will have to modify the code but make sure to stay within the 2000 bar limit. Also, this RVOL is 5 minutes delayed because it is based on the prior 5-minute bar. This is intentional because if you use the current bar it will reset to zero every 5 minutes. RVOL can be calculated in many different ways with different results. I don't believe TOS is capable of producing the same exact intraday adjusted RVOL that other trading platforms have because it limits our calculations to just 2000 historical bars. I have tried many variations of RVOL calculations within TOS now and I've settled on this one. I also use DAS and this seems to follow it somewhat close.

If you want it to read in % as you were requesting, then just multiply the RelVolume by 100. (def RelVolume = (volume(period = AggregationPeriod.FIVE_MIN) / AvgVolumePer5Minutes)*100;

Text font size is not adjustable on a label.

# Define the length of the lookback period for the average volume calculation (in days)
input LookbackDays = 25;
# Define the number of 5-minute bars in a regular trading day (assumed to be 390 minutes)
def BarsPerDay = 78; # 390 minutes divided by 5-minute intervals
# Calculate the number of bars in the lookback period
def NumBars = LookbackDays * BarsPerDay;
# Calculate the total volume over the lookback period using 5-minute bars
def TotalVolume = Sum(volume(period = AggregationPeriod.FIVE_MIN), NumBars);
# Calculate the average volume per 5-minute bar over the lookback period
def AvgVolumePer5Minutes = TotalVolume / NumBars;
# Calculate the relative volume per 5-minute bar
def RelVolume = volume(period = AggregationPeriod.FIVE_MIN) / AvgVolumePer5Minutes;

AddLabel(yes, "RVOL: " + Round(RelVolume[1], 1), if RelVolume > 3 then Color.UPTICK else if RelVolume > 2 then Color.YELLOW else Color.LIGHT_GRAY);

  • This calculates the relative volume (RVOL) for the current bar based on a user-defined lookback period, adjusted to stay within the 2000-bar historical limit.
  • It then displays this relative volume on the chart with a color-coded label, which is yellow if the RVOL is greater than 2 and green if it is greater than 3.
  • Adjust the colors however you like directly in the code
  • This does not work in premarket
ChartLabel Study:
http://tos.mx/!NMGqx11s

WatchlistColumn:
http://tos.mx/!w6jpdbi0
 
Last edited:
Solution

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