Looking for Relative Volume Indicator

A

ankbhard

New member
Hello,

Just wondering if anyone knows if TOS has a Relative Volume Indicator...?

I found the similar one, Sizzle Index, but it seems to be applicable to the Options volume and not the Equity volume. ..

 
Last edited:
BenTen

BenTen

Administrative
Staff
VIP
Warehouse
@ankbhard Try this one

Rich (BB code):
## OneNote Archive Name: Relative Volume to past days Average Relative Volume _v02_Mobius
## Suggested Tos Name using JQ naming convention: RelVolumeVsAvgRelVolume_v02_Mobius
## OneNote Section: Volume    
## Archive Date: 02.10.2019    
## Provenance: Posted by Mobius himself in the Lounge on 02.05.2019

## Archive, Usage or Lounge Notes: 
# 09:18 Mobius: david - 

## End OneNote Archive Header
# Relative Volume to past days Average Relative Volume
# Mobius
# Chat Room Request 01.23.2017

input length = 60;

def v = volume(period = AggregationPeriod.Day);
def active = if secondsFromTime(0930) > 0 and
                secondsTillTime(1600) >= 0
             then 1
             else 0;
def Bars = Ceil((RegularTradingEnd(20160104) - RegularTradingStart(20160104))
                / GetAggregationPeriod());
def newDay = GetDay() != GetDay()[1];
def DayVol = if newDay
                  then v
                  else DayVol[1] + v;
def avgVolume = (fold day = 0 to length 
                 with s 
                 do s + GetValue(DayVol, day * Bars, (length - 1) * Bars)) / length;

plot R = DayVol / avgVolume * 100;
     R.SetPaintingStrategy(PaintingStrategy.Histogram);
     R.AssignValueColor(if R > 100
                                then color.green
                                else color.red);
# End Code
 
Last edited:
markos

markos

Well-known member
VIP
Warehouse
@ankbhard Besides the study that @BenTen posted there is a built in Stock Sizzle indicator for use in watchlists.
 
Last edited by a moderator:
markos

markos

Well-known member
VIP
Warehouse
If those don't suit, try this: btw, I can't help with color on this one.
Code:
#From StanL Treepad database ~2014
# RCG3: Unusual volume
input price = volume;
input choice = {default increased, decreased};
input percent = 20;
input length = 50;
def avg = average(price, length)[1];
def chg = 100*(price/avg -1);
plot scan;

switch (choice) {
case increased:
scan = chg >= percent;
case decreased:
scan = chg <= -percent;
}
#end
 
Last edited by a moderator:
S

San

Member
VIP
BenTen/ markos
I tried to copy above code but i don't see anything on the chart. If you can pleas post screen shot.

I have other query: Is it possible to show the indicator top of the chart instead of lower. Example volume RSI or Volume or Customize indicator on top instead of lower.
 
Last edited by a moderator:
BenTen

BenTen

Administrative
Staff
VIP
Warehouse
@San You mean displaying them as labels on the upper chart?
 
markos

markos

Well-known member
VIP
Warehouse
BenTen/ markos
I tried to copy above code but i don't see anything on the chart. If you can pleas post screen shot.

I have other query: Is it possible to show the indicator top of the chart instead of lower. Example volume RSI or Volume or Customize indicator on top instead of lower.
@San
Please be more clear about what you are saying. There are two codes above, the one on the top paints as a histogram.
The code on the bottom is a scan only. You may have to change the code a little bit to do other things.
If you want a lower study in the upper chart area, open the studies on your chart and simply drag the study from the lower to the upper pane.

Otherwise, please spend some time in the Onenote, the manual and other supporting documentation from TOS is on the second tab.
 
S

San

Member
VIP
@BenTen/ @markos,

I copied your question and answer for your Q:

Q: There are two codes above, the one on the top paints as a histogram. Ans: I don't see the histogram code.
Q: You mean displaying them as labels on the upper chart? - No I want see the Indicator itself on the upper chart.

Example:
Upper MACD Indicator
Middle Stock candle chart.
Lower: RSI chart.
 
Last edited by a moderator:
markos

markos

Well-known member
VIP
Warehouse
@San take a close look at the first code above. It has two dates in it, both of them are 2016. That is probably why it would not show up. That may or may not be the one you want but if it is please adjust the date.

Regarding the second issue, seeing the indicator itself on the upper chart. The answer there is no, tos is made to put the indicators on the bottom primarily. That would be a good question for support. Use the search bar above and type in the word SECRET, and that should give you the right phone number to call.
 
Last edited:
S

San

Member
VIP
@markos, Hey thanks for your response. I see some video in Youtube, I forgot the link... which shows the indicator top and bottom.. thats y i ask that question..I try to call support and let you know the status If i find.
 
S

San

Member
VIP
@Gmrat468, Instead of Label I need Full indicator. Example : I want to see the RSI indicator TOP Middle actual chart Bottom MACD.
 
markos

markos

Well-known member
VIP
Warehouse
Here's the label!
Can this be put up as a label ?


Code:
#Paris in TSL on 1/15/18
# Volume Pct Relative # blt
# 10.5.2016
input length = 50;
def RelVol = volume(period = AggregationPeriod.DAY) / Average(volume(period = AggregationPeriod.DAY), length);
AddLabel(1, "Todays Volume / Avg Volume " +
AsPercent(RelVol),
if volume(period = AggregationPeriod.DAY)
> Average(volume(period =
AggregationPeriod.DAY), length)
then Color.GREEN
else Color.RED);
#End of Label Code#
http://tos.mx/M3rYDC
 
Last edited:
markos

markos

Well-known member
VIP
Warehouse
Perfect , Thank Marcos
You are most welcome! :) A little trick for you; Go into the studies beaker, open it up, and drag the study to the top if you want it at the top of the main chart.
Please type in "Universe" in the search box and browse around the Universe of Thinkscript. There is more there than one can memorize.
 
T

thinky

Member
@markos What's the input length (50) in the label code?

Some firms use Relative Volume as a number below or above 1, I imagine this is 100% to agree with the label indicator output.
 
markos

markos

Well-known member
VIP
Warehouse
@markos What's the input length (50) in the label code?

Some firms use Relative Volume as a number below or above 1, I imagine this is 100% to agree with the label indicator output.
@thinky This is a good code learn from. If you were to look up Relative Volume in the Universe of Think script, you would find that Relative Volume uses the Simple Moving Average. Therefore, it compares today's volume versus the average of the last 50 days. I hope that helps.
 
markos

markos

Well-known member
VIP
Warehouse
there are several Relative volume indicators and labels here.
 
G

GetRichOrDieTrying

Member
Here's the label!



Code:
#Paris in TSL on 1/15/18
# Volume Pct Relative # blt
# 10.5.2016
input length = 50;
def RelVol = volume(period = AggregationPeriod.DAY) / Average(volume(period = AggregationPeriod.DAY), length);
AddLabel(1, "Todays Volume / Avg Volume " +
AsPercent(RelVol),
if volume(period = AggregationPeriod.DAY)
> Average(volume(period =
AggregationPeriod.DAY), length)
then Color.GREEN
else Color.RED);
#End of Label Code#
http://tos.mx/M3rYDC
@markos Is it possible to add the volume increase percentage number shown in your screenshot in a scan and watchlist as a column? It would be incredible to be able to sort by this number.
 
K

kolij

New member
Hi, I would like to ask if there is any study for relative volume on intraday time frames, actual volume done by that time of the day compared to average volume done by that time of day?
 

Top