RVOL (Relative Volume) Scan Label Watchlist for ThinkorSwim

anycolour

Member
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!
 
Have a look at this twitter post from a very good thinkscript coder. He has a lot of cool scripts including Volume Forecast.
May i ask how you are using the Rvol in your trading plan? What is it that you`re looking for with this indicator?
 
Last edited by a moderator:
TOS has an RVOL, I use it on my watchlist, its under RelativeVolumeStDev. Try that.

Code:
# Relative Volume Std Dev - Colored By Price
# LongShort
# 5.6.2014
#
# Modified the TOS RelativeVolumeStdDev study to color histogram by price
# candle action. This has been configured for 2 standard deviaitions, so
# those bars were really big volume compared to "normal"
#
# While Mobius likes his Volume Percent R study, I like this version
# which uses standard deviation of volume. It finds unusual volume bars
# significantly different than the average.
#
# The study colors volume bars with "unusual/abnormal volume", greater
# than 2.0 StdDev away. Relative volume bars that exceed a 2.0 StdDev
# of volume are colored green or red. If it is less than 2 StdDev (i.e".
# normal" volume ) they are colored gray
#
# Volume = Validation. hence a trend change or big move on a colored bar is
# significant. A trend change or big move on a gray bar doesn't garner
# much respect.
#
# I use this study for finding volume outliers. It is a volume study used
# to highlight extreme volume or volume spikes. This study is based on standard
# deviation of volume being outside the normal distribution, and is similar
# in concept to Mobius’ Volume %R study.
#
# Mobius version is a relative Volume %R study which simply reduces the
# last 20 bars to a scale of 0 to 100. It tends to nail the volume at swings.
#
# I have been using 60 as the default aggregation. It is more sensitive to
# length because volume picked up after the recent market volatility. This
# is a change in market dynamics. On a daily chart, set the aggregation to
# a shorter length, about 25.
#
# Signals:
# Oversold   - you want RelVol above StdDevLevel and RelVol.Color Bullish
# Overbought - you want RelVol above StdDevLevel and RelVol.Color Bearish
#
# While some volume bars may not be very high, the ones that are signals
# are colored. Volume = Validation. If a move doesn't happen with big volume,
# are the big institutions really on board with the move?
#
# A 2.0 SD above normal volume is considered big volume; you could also use
# other settings
#
# Note that the longer colored bars co-incide with the following 4 scenarios
#
# A) the start of the trading session
# B) the end of the trading session
# C) big moves
# D) new lows
#
# This study provides useful trading information like for example:
#
# What color are the bars at the start of the week on the move down
# What color are the bars in the middle of the week on the new lows
# Did we get a bunch of green bars after we hit the new lows (indicating buying support)
# What color are the bars at the end of the week

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("Bullish", GetColor(6));
RelVol.DefineColor("Bearish", GetColor(5));
RelVol.DefineColor("Neutral", GetColor(7));

RelVol.AssignValueColor(if close >= open and RelVol > numDev then RelVol.Color("Bullish") else if close < open and RelVol > numDev then RelVol.Color("Bearish") else RelVol.Color("Neutral") );

StDevLevel.SetDefaultColor(GetColor(7));
StDevLevel.SetStyle(Curve.SHORT_DASH);

# End Study
 
Here is the written code from the link @zeek provided:

Short version:

Code:
def rVol = volume / Average(volume, 21)[1];

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

Long version:

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);
 
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
 
Thank you, I don't know anything about coding. Is this a standalone or how do I add it to the watchlist?! Also, what exactly would be the difference between using the Short vs Long version on a watchlist? Thanks I made it work, but the yellow color background makes the numbers unseeable.

Ok, most important question (I think I've made it work). Look at my current watchlist. Look at the R-Vol values. Each of the is zero point something. That means that relative volume for that day was lower than for the RVOL given period (which is average daily volume over last 30 days?) correct?

So if I had a R-Vol value of 5, the relative volume for that day would be 5 times the average daily volume of that stock over a 30 day period?

Lw7xqEi.jpg


Thanks
 
Last edited by a moderator:
@anycolour In the code I posted a value of 5 signifies the relative volume for that day is 5 times the average daily volume over a 20 day period
In your snapshot of AMD, ROKU, AMZN, etc it is < 1 meaning the volume was significantly lower than the 20 day average
 
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
 
Thank you Deus. Please let us know (share) the Zanger V Ratio once (if) you develop it. If you chose to share it freely. Thank you!

One more crucial thing, maybe someone knows and can help me on how to do it:

brbx8ro.jpg


I want to create a scan condition where it only shows me stocks with an R-VOL of at least 2. How can I do this?

Thank you!
 

Attachments

  • brbx8ro.jpg
    brbx8ro.jpg
    42 KB · Views: 394
Last edited by a moderator:
Here is a Zanger volume study. See if you can figure a use and let everyone know.

Code:
#fl_zanger_volume_ratio_accumSTUDY.ts
#
#Fil
#Creation date: 10/17/2015
#Edit Log (Date/Editor):
#
#
#
#hint: Conversion of eSignal ZVR; see http://www.esignal.com/partners/add-on-formula-studies/chartpattern.aspx
#hint i_print_label_accumulation: Toggles the <b>ACCUMULATION</b> label
#hint i_print_label_pct: Toggles the <b>PERCENT</b> label
#hint i_days_length: Specifies the number of days over which to compute the average <b>DAILY</b> volume

#INPUTS
input i_print_label_accumulation = YES;
input i_print_label_pct = YES;
input i_days_length = 25;

#ESTABLISH RTH
def v_days_from_epoch = DaysFromDate(19700101);
def v_rth_start = (RegularTradingStart(GetYYYYMMDD()))/(1000*60*60*24);
def v_rth_start_in_minutes = Round((24*(v_rth_start-v_days_from_epoch)-5)*60,0);

def v_rth_end = (RegularTradingEnd(GetYYYYMMDD()))/(1000*60*60*24);
def v_rth_end_in_minutes = Round((24*(v_rth_end-v_days_from_epoch)-5)*60,0);

def v_eth_pre = if SecondsFromTime(0)/60 < v_rth_start_in_minutes then 1 else 0;
def v_eth_post = if SecondsFromTime(0)/60 >= v_rth_end_in_minutes then 1 else 0;
def v_rth = if (SecondsFromTime(0)/60) >= v_rth_start_in_minutes and (SecondsFromTime(0)/60) < v_rth_end_in_minutes then 1 else 0;

#COUNTERS AND STATES
def v_agg_period = GetAggregationPeriod()/1000;
def v_rth_barnum = if v_rth then RoundDown((SecondsFromTime(0)-v_rth_start_in_minutes*60)/v_agg_period, 0) + 1 else 0;
def v_max_bars_in_rth = (v_rth_end_in_minutes - v_rth_start_in_minutes)*60/v_agg_period;

def v_days = CompoundValue(1, if GetYYYYMMDD() <> GetYYYYMMDD()[1] then v_days[1] + 1 else v_days[1],1);
def v_days_divisor = if v_days > 1 then (if v_eth_pre then v_days - 1 else v_days) else 1;

#RELATIVE INDIVIDUAL BAR VOLUME
def v_aggregated_volume_001 = if v_rth_barnum == 1 then v_aggregated_volume_001[1] + volume else if 1 <= v_max_bars_in_rth then v_aggregated_volume_001[1] else Double.NaN;
def v_aggregated_volume_002 = if v_rth_barnum == 2 then v_aggregated_volume_002[1] + volume else if 2 <= v_max_bars_in_rth then v_aggregated_volume_002[1] else Double.NaN;
def v_aggregated_volume_003 = if v_rth_barnum == 3 then v_aggregated_volume_003[1] + volume else if 3 <= v_max_bars_in_rth then v_aggregated_volume_003[1] else Double.NaN;
def v_aggregated_volume_004 = if v_rth_barnum == 4 then v_aggregated_volume_004[1] + volume else if 4 <= v_max_bars_in_rth then v_aggregated_volume_004[1] else Double.NaN;
def v_aggregated_volume_005 = if v_rth_barnum == 5 then v_aggregated_volume_005[1] + volume else if 5 <= v_max_bars_in_rth then v_aggregated_volume_005[1] else Double.NaN;
def v_aggregated_volume_006 = if v_rth_barnum == 6 then v_aggregated_volume_006[1] + volume else if 6 <= v_max_bars_in_rth then v_aggregated_volume_006[1] else Double.NaN;
def v_aggregated_volume_007 = if v_rth_barnum == 7 then v_aggregated_volume_007[1] + volume else if 7 <= v_max_bars_in_rth then v_aggregated_volume_007[1] else Double.NaN;
def v_aggregated_volume_008 = if v_rth_barnum == 8 then v_aggregated_volume_008[1] + volume else if 8 <= v_max_bars_in_rth then v_aggregated_volume_008[1] else Double.NaN;
def v_aggregated_volume_009 = if v_rth_barnum == 9 then v_aggregated_volume_009[1] + volume else if 9 <= v_max_bars_in_rth then v_aggregated_volume_009[1] else Double.NaN;
def v_aggregated_volume_010 = if v_rth_barnum == 10 then v_aggregated_volume_010[1] + volume else if 10 <= v_max_bars_in_rth then v_aggregated_volume_010[1] else Double.NaN;
def v_aggregated_volume_011 = if v_rth_barnum == 11 then v_aggregated_volume_011[1] + volume else if 11 <= v_max_bars_in_rth then v_aggregated_volume_011[1] else Double.NaN;
def v_aggregated_volume_012 = if v_rth_barnum == 12 then v_aggregated_volume_012[1] + volume else if 12 <= v_max_bars_in_rth then v_aggregated_volume_012[1] else Double.NaN;
def v_aggregated_volume_013 = if v_rth_barnum == 13 then v_aggregated_volume_013[1] + volume else if 13 <= v_max_bars_in_rth then v_aggregated_volume_013[1] else Double.NaN;
def v_aggregated_volume_014 = if v_rth_barnum == 14 then v_aggregated_volume_014[1] + volume else if 14 <= v_max_bars_in_rth then v_aggregated_volume_014[1] else Double.NaN;
def v_aggregated_volume_015 = if v_rth_barnum == 15 then v_aggregated_volume_015[1] + volume else if 15 <= v_max_bars_in_rth then v_aggregated_volume_015[1] else Double.NaN;
def v_aggregated_volume_016 = if v_rth_barnum == 16 then v_aggregated_volume_016[1] + volume else if 16 <= v_max_bars_in_rth then v_aggregated_volume_016[1] else Double.NaN;
def v_aggregated_volume_017 = if v_rth_barnum == 17 then v_aggregated_volume_017[1] + volume else if 17 <= v_max_bars_in_rth then v_aggregated_volume_017[1] else Double.NaN;
def v_aggregated_volume_018 = if v_rth_barnum == 18 then v_aggregated_volume_018[1] + volume else if 18 <= v_max_bars_in_rth then v_aggregated_volume_018[1] else Double.NaN;
def v_aggregated_volume_019 = if v_rth_barnum == 19 then v_aggregated_volume_019[1] + volume else if 19 <= v_max_bars_in_rth then v_aggregated_volume_019[1] else Double.NaN;
def v_aggregated_volume_020 = if v_rth_barnum == 20 then v_aggregated_volume_020[1] + volume else if 20 <= v_max_bars_in_rth then v_aggregated_volume_020[1] else Double.NaN;
def v_aggregated_volume_021 = if v_rth_barnum == 21 then v_aggregated_volume_021[1] + volume else if 21 <= v_max_bars_in_rth then v_aggregated_volume_021[1] else Double.NaN;
def v_aggregated_volume_022 = if v_rth_barnum == 22 then v_aggregated_volume_022[1] + volume else if 22 <= v_max_bars_in_rth then v_aggregated_volume_022[1] else Double.NaN;
def v_aggregated_volume_023 = if v_rth_barnum == 23 then v_aggregated_volume_023[1] + volume else if 23 <= v_max_bars_in_rth then v_aggregated_volume_023[1] else Double.NaN;
def v_aggregated_volume_024 = if v_rth_barnum == 24 then v_aggregated_volume_024[1] + volume else if 24 <= v_max_bars_in_rth then v_aggregated_volume_024[1] else Double.NaN;
def v_aggregated_volume_025 = if v_rth_barnum == 25 then v_aggregated_volume_025[1] + volume else if 25 <= v_max_bars_in_rth then v_aggregated_volume_025[1] else Double.NaN;
def v_aggregated_volume_026 = if v_rth_barnum == 26 then v_aggregated_volume_026[1] + volume else if 26 <= v_max_bars_in_rth then v_aggregated_volume_026[1] else Double.NaN;
def v_aggregated_volume_027 = if v_rth_barnum == 27 then v_aggregated_volume_027[1] + volume else if 27 <= v_max_bars_in_rth then v_aggregated_volume_027[1] else Double.NaN;
def v_aggregated_volume_028 = if v_rth_barnum == 28 then v_aggregated_volume_028[1] + volume else if 28 <= v_max_bars_in_rth then v_aggregated_volume_028[1] else Double.NaN;
def v_aggregated_volume_029 = if v_rth_barnum == 29 then v_aggregated_volume_029[1] + volume else if 29 <= v_max_bars_in_rth then v_aggregated_volume_029[1] else Double.NaN;
def v_aggregated_volume_030 = if v_rth_barnum == 30 then v_aggregated_volume_030[1] + volume else if 30 <= v_max_bars_in_rth then v_aggregated_volume_030[1] else Double.NaN;
def v_aggregated_volume_031 = if v_rth_barnum == 31 then v_aggregated_volume_031[1] + volume else if 31 <= v_max_bars_in_rth then v_aggregated_volume_031[1] else Double.NaN;
def v_aggregated_volume_032 = if v_rth_barnum == 32 then v_aggregated_volume_032[1] + volume else if 32 <= v_max_bars_in_rth then v_aggregated_volume_032[1] else Double.NaN;
def v_aggregated_volume_033 = if v_rth_barnum == 33 then v_aggregated_volume_033[1] + volume else if 33 <= v_max_bars_in_rth then v_aggregated_volume_033[1] else Double.NaN;
def v_aggregated_volume_034 = if v_rth_barnum == 34 then v_aggregated_volume_034[1] + volume else if 34 <= v_max_bars_in_rth then v_aggregated_volume_034[1] else Double.NaN;
def v_aggregated_volume_035 = if v_rth_barnum == 35 then v_aggregated_volume_035[1] + volume else if 35 <= v_max_bars_in_rth then v_aggregated_volume_035[1] else Double.NaN;
def v_aggregated_volume_036 = if v_rth_barnum == 36 then v_aggregated_volume_036[1] + volume else if 36 <= v_max_bars_in_rth then v_aggregated_volume_036[1] else Double.NaN;
def v_aggregated_volume_037 = if v_rth_barnum == 37 then v_aggregated_volume_037[1] + volume else if 37 <= v_max_bars_in_rth then v_aggregated_volume_037[1] else Double.NaN;
def v_aggregated_volume_038 = if v_rth_barnum == 38 then v_aggregated_volume_038[1] + volume else if 38 <= v_max_bars_in_rth then v_aggregated_volume_038[1] else Double.NaN;
def v_aggregated_volume_039 = if v_rth_barnum == 39 then v_aggregated_volume_039[1] + volume else if 39 <= v_max_bars_in_rth then v_aggregated_volume_039[1] else Double.NaN;
def v_aggregated_volume_040 = if v_rth_barnum == 40 then v_aggregated_volume_040[1] + volume else if 40 <= v_max_bars_in_rth then v_aggregated_volume_040[1] else Double.NaN;
def v_aggregated_volume_041 = if v_rth_barnum == 41 then v_aggregated_volume_041[1] + volume else if 41 <= v_max_bars_in_rth then v_aggregated_volume_041[1] else Double.NaN;
def v_aggregated_volume_042 = if v_rth_barnum == 42 then v_aggregated_volume_042[1] + volume else if 42 <= v_max_bars_in_rth then v_aggregated_volume_042[1] else Double.NaN;
def v_aggregated_volume_043 = if v_rth_barnum == 43 then v_aggregated_volume_043[1] + volume else if 43 <= v_max_bars_in_rth then v_aggregated_volume_043[1] else Double.NaN;
def v_aggregated_volume_044 = if v_rth_barnum == 44 then v_aggregated_volume_044[1] + volume else if 44 <= v_max_bars_in_rth then v_aggregated_volume_044[1] else Double.NaN;
def v_aggregated_volume_045 = if v_rth_barnum == 45 then v_aggregated_volume_045[1] + volume else if 45 <= v_max_bars_in_rth then v_aggregated_volume_045[1] else Double.NaN;
def v_aggregated_volume_046 = if v_rth_barnum == 46 then v_aggregated_volume_046[1] + volume else if 46 <= v_max_bars_in_rth then v_aggregated_volume_046[1] else Double.NaN;
def v_aggregated_volume_047 = if v_rth_barnum == 47 then v_aggregated_volume_047[1] + volume else if 47 <= v_max_bars_in_rth then v_aggregated_volume_047[1] else Double.NaN;
def v_aggregated_volume_048 = if v_rth_barnum == 48 then v_aggregated_volume_048[1] + volume else if 48 <= v_max_bars_in_rth then v_aggregated_volume_048[1] else Double.NaN;
def v_aggregated_volume_049 = if v_rth_barnum == 49 then v_aggregated_volume_049[1] + volume else if 49 <= v_max_bars_in_rth then v_aggregated_volume_049[1] else Double.NaN;
def v_aggregated_volume_050 = if v_rth_barnum == 50 then v_aggregated_volume_050[1] + volume else if 50 <= v_max_bars_in_rth then v_aggregated_volume_050[1] else Double.NaN;
def v_aggregated_volume_051 = if v_rth_barnum == 51 then v_aggregated_volume_051[1] + volume else if 51 <= v_max_bars_in_rth then v_aggregated_volume_051[1] else Double.NaN;
def v_aggregated_volume_052 = if v_rth_barnum == 52 then v_aggregated_volume_052[1] + volume else if 52 <= v_max_bars_in_rth then v_aggregated_volume_052[1] else Double.NaN;
def v_aggregated_volume_053 = if v_rth_barnum == 53 then v_aggregated_volume_053[1] + volume else if 53 <= v_max_bars_in_rth then v_aggregated_volume_053[1] else Double.NaN;
def v_aggregated_volume_054 = if v_rth_barnum == 54 then v_aggregated_volume_054[1] + volume else if 54 <= v_max_bars_in_rth then v_aggregated_volume_054[1] else Double.NaN;
def v_aggregated_volume_055 = if v_rth_barnum == 55 then v_aggregated_volume_055[1] + volume else if 55 <= v_max_bars_in_rth then v_aggregated_volume_055[1] else Double.NaN;
def v_aggregated_volume_056 = if v_rth_barnum == 56 then v_aggregated_volume_056[1] + volume else if 56 <= v_max_bars_in_rth then v_aggregated_volume_056[1] else Double.NaN;
def v_aggregated_volume_057 = if v_rth_barnum == 57 then v_aggregated_volume_057[1] + volume else if 57 <= v_max_bars_in_rth then v_aggregated_volume_057[1] else Double.NaN;
def v_aggregated_volume_058 = if v_rth_barnum == 58 then v_aggregated_volume_058[1] + volume else if 58 <= v_max_bars_in_rth then v_aggregated_volume_058[1] else Double.NaN;
def v_aggregated_volume_059 = if v_rth_barnum == 59 then v_aggregated_volume_059[1] + volume else if 59 <= v_max_bars_in_rth then v_aggregated_volume_059[1] else Double.NaN;
def v_aggregated_volume_060 = if v_rth_barnum == 60 then v_aggregated_volume_060[1] + volume else if 60 <= v_max_bars_in_rth then v_aggregated_volume_060[1] else Double.NaN;
def v_aggregated_volume_061 = if v_rth_barnum == 61 then v_aggregated_volume_061[1] + volume else if 61 <= v_max_bars_in_rth then v_aggregated_volume_061[1] else Double.NaN;
def v_aggregated_volume_062 = if v_rth_barnum == 62 then v_aggregated_volume_062[1] + volume else if 62 <= v_max_bars_in_rth then v_aggregated_volume_062[1] else Double.NaN;
def v_aggregated_volume_063 = if v_rth_barnum == 63 then v_aggregated_volume_063[1] + volume else if 63 <= v_max_bars_in_rth then v_aggregated_volume_063[1] else Double.NaN;
def v_aggregated_volume_064 = if v_rth_barnum == 64 then v_aggregated_volume_064[1] + volume else if 64 <= v_max_bars_in_rth then v_aggregated_volume_064[1] else Double.NaN;
def v_aggregated_volume_065 = if v_rth_barnum == 65 then v_aggregated_volume_065[1] + volume else if 65 <= v_max_bars_in_rth then v_aggregated_volume_065[1] else Double.NaN;
def v_aggregated_volume_066 = if v_rth_barnum == 66 then v_aggregated_volume_066[1] + volume else if 66 <= v_max_bars_in_rth then v_aggregated_volume_066[1] else Double.NaN;
def v_aggregated_volume_067 = if v_rth_barnum == 67 then v_aggregated_volume_067[1] + volume else if 67 <= v_max_bars_in_rth then v_aggregated_volume_067[1] else Double.NaN;
def v_aggregated_volume_068 = if v_rth_barnum == 68 then v_aggregated_volume_068[1] + volume else if 68 <= v_max_bars_in_rth then v_aggregated_volume_068[1] else Double.NaN;
def v_aggregated_volume_069 = if v_rth_barnum == 69 then v_aggregated_volume_069[1] + volume else if 69 <= v_max_bars_in_rth then v_aggregated_volume_069[1] else Double.NaN;
def v_aggregated_volume_070 = if v_rth_barnum == 70 then v_aggregated_volume_070[1] + volume else if 70 <= v_max_bars_in_rth then v_aggregated_volume_070[1] else Double.NaN;
def v_aggregated_volume_071 = if v_rth_barnum == 71 then v_aggregated_volume_071[1] + volume else if 71 <= v_max_bars_in_rth then v_aggregated_volume_071[1] else Double.NaN;
def v_aggregated_volume_072 = if v_rth_barnum == 72 then v_aggregated_volume_072[1] + volume else if 72 <= v_max_bars_in_rth then v_aggregated_volume_072[1] else Double.NaN;
def v_aggregated_volume_073 = if v_rth_barnum == 73 then v_aggregated_volume_073[1] + volume else if 73 <= v_max_bars_in_rth then v_aggregated_volume_073[1] else Double.NaN;
def v_aggregated_volume_074 = if v_rth_barnum == 74 then v_aggregated_volume_074[1] + volume else if 74 <= v_max_bars_in_rth then v_aggregated_volume_074[1] else Double.NaN;
def v_aggregated_volume_075 = if v_rth_barnum == 75 then v_aggregated_volume_075[1] + volume else if 75 <= v_max_bars_in_rth then v_aggregated_volume_075[1] else Double.NaN;
def v_aggregated_volume_076 = if v_rth_barnum == 76 then v_aggregated_volume_076[1] + volume else if 76 <= v_max_bars_in_rth then v_aggregated_volume_076[1] else Double.NaN;
def v_aggregated_volume_077 = if v_rth_barnum == 77 then v_aggregated_volume_077[1] + volume else if 77 <= v_max_bars_in_rth then v_aggregated_volume_077[1] else Double.NaN;
def v_aggregated_volume_078 = if v_rth_barnum == 78 then v_aggregated_volume_078[1] + volume else if 78 <= v_max_bars_in_rth then v_aggregated_volume_078[1] else Double.NaN;
def v_aggregated_volume_079 = if v_rth_barnum == 79 then v_aggregated_volume_079[1] + volume else if 79 <= v_max_bars_in_rth then v_aggregated_volume_079[1] else Double.NaN;
def v_aggregated_volume_080 = if v_rth_barnum == 80 then v_aggregated_volume_080[1] + volume else if 80 <= v_max_bars_in_rth then v_aggregated_volume_080[1] else Double.NaN;
def v_aggregated_volume_081 = if v_rth_barnum == 81 then v_aggregated_volume_081[1] + volume else if 81 <= v_max_bars_in_rth then v_aggregated_volume_081[1] else Double.NaN;
def v_aggregated_volume_082 = if v_rth_barnum == 82 then v_aggregated_volume_082[1] + volume else if 82 <= v_max_bars_in_rth then v_aggregated_volume_082[1] else Double.NaN;
def v_aggregated_volume_083 = if v_rth_barnum == 83 then v_aggregated_volume_083[1] + volume else if 83 <= v_max_bars_in_rth then v_aggregated_volume_083[1] else Double.NaN;
def v_aggregated_volume_084 = if v_rth_barnum == 84 then v_aggregated_volume_084[1] + volume else if 84 <= v_max_bars_in_rth then v_aggregated_volume_084[1] else Double.NaN;
def v_aggregated_volume_085 = if v_rth_barnum == 85 then v_aggregated_volume_085[1] + volume else if 85 <= v_max_bars_in_rth then v_aggregated_volume_085[1] else Double.NaN;
def v_aggregated_volume_086 = if v_rth_barnum == 86 then v_aggregated_volume_086[1] + volume else if 86 <= v_max_bars_in_rth then v_aggregated_volume_086[1] else Double.NaN;
def v_aggregated_volume_087 = if v_rth_barnum == 87 then v_aggregated_volume_087[1] + volume else if 87 <= v_max_bars_in_rth then v_aggregated_volume_087[1] else Double.NaN;
def v_aggregated_volume_088 = if v_rth_barnum == 88 then v_aggregated_volume_088[1] + volume else if 88 <= v_max_bars_in_rth then v_aggregated_volume_088[1] else Double.NaN;
def v_aggregated_volume_089 = if v_rth_barnum == 89 then v_aggregated_volume_089[1] + volume else if 89 <= v_max_bars_in_rth then v_aggregated_volume_089[1] else Double.NaN;
def v_aggregated_volume_090 = if v_rth_barnum == 90 then v_aggregated_volume_090[1] + volume else if 90 <= v_max_bars_in_rth then v_aggregated_volume_090[1] else Double.NaN;
def v_aggregated_volume_091 = if v_rth_barnum == 91 then v_aggregated_volume_091[1] + volume else if 91 <= v_max_bars_in_rth then v_aggregated_volume_091[1] else Double.NaN;
def v_aggregated_volume_092 = if v_rth_barnum == 92 then v_aggregated_volume_092[1] + volume else if 92 <= v_max_bars_in_rth then v_aggregated_volume_092[1] else Double.NaN;
def v_aggregated_volume_093 = if v_rth_barnum == 93 then v_aggregated_volume_093[1] + volume else if 93 <= v_max_bars_in_rth then v_aggregated_volume_093[1] else Double.NaN;
def v_aggregated_volume_094 = if v_rth_barnum == 94 then v_aggregated_volume_094[1] + volume else if 94 <= v_max_bars_in_rth then v_aggregated_volume_094[1] else Double.NaN;
def v_aggregated_volume_095 = if v_rth_barnum == 95 then v_aggregated_volume_095[1] + volume else if 95 <= v_max_bars_in_rth then v_aggregated_volume_095[1] else Double.NaN;
def v_aggregated_volume_096 = if v_rth_barnum == 96 then v_aggregated_volume_096[1] + volume else if 96 <= v_max_bars_in_rth then v_aggregated_volume_096[1] else Double.NaN;
def v_aggregated_volume_097 = if v_rth_barnum == 97 then v_aggregated_volume_097[1] + volume else if 97 <= v_max_bars_in_rth then v_aggregated_volume_097[1] else Double.NaN;
def v_aggregated_volume_098 = if v_rth_barnum == 98 then v_aggregated_volume_098[1] + volume else if 98 <= v_max_bars_in_rth then v_aggregated_volume_098[1] else Double.NaN;
def v_aggregated_volume_099 = if v_rth_barnum == 99 then v_aggregated_volume_099[1] + volume else if 99 <= v_max_bars_in_rth then v_aggregated_volume_099[1] else Double.NaN;
def v_aggregated_volume_100 = if v_rth_barnum == 100 then v_aggregated_volume_100[1] + volume else if 100 <= v_max_bars_in_rth then v_aggregated_volume_100[1] else Double.NaN;
def v_aggregated_volume_101 = if v_rth_barnum == 101 then v_aggregated_volume_101[1] + volume else if 101 <= v_max_bars_in_rth then v_aggregated_volume_101[1] else Double.NaN;
def v_aggregated_volume_102 = if v_rth_barnum == 102 then v_aggregated_volume_102[1] + volume else if 102 <= v_max_bars_in_rth then v_aggregated_volume_102[1] else Double.NaN;
def v_aggregated_volume_103 = if v_rth_barnum == 103 then v_aggregated_volume_103[1] + volume else if 103 <= v_max_bars_in_rth then v_aggregated_volume_103[1] else Double.NaN;
def v_aggregated_volume_104 = if v_rth_barnum == 104 then v_aggregated_volume_104[1] + volume else if 104 <= v_max_bars_in_rth then v_aggregated_volume_104[1] else Double.NaN;
def v_aggregated_volume_105 = if v_rth_barnum == 105 then v_aggregated_volume_105[1] + volume else if 105 <= v_max_bars_in_rth then v_aggregated_volume_105[1] else Double.NaN;
def v_aggregated_volume_106 = if v_rth_barnum == 106 then v_aggregated_volume_106[1] + volume else if 106 <= v_max_bars_in_rth then v_aggregated_volume_106[1] else Double.NaN;
def v_aggregated_volume_107 = if v_rth_barnum == 107 then v_aggregated_volume_107[1] + volume else if 107 <= v_max_bars_in_rth then v_aggregated_volume_107[1] else Double.NaN;
def v_aggregated_volume_108 = if v_rth_barnum == 108 then v_aggregated_volume_108[1] + volume else if 108 <= v_max_bars_in_rth then v_aggregated_volume_108[1] else Double.NaN;
def v_aggregated_volume_109 = if v_rth_barnum == 109 then v_aggregated_volume_109[1] + volume else if 109 <= v_max_bars_in_rth then v_aggregated_volume_109[1] else Double.NaN;
def v_aggregated_volume_110 = if v_rth_barnum == 110 then v_aggregated_volume_110[1] + volume else if 110 <= v_max_bars_in_rth then v_aggregated_volume_110[1] else Double.NaN;
def v_aggregated_volume_111 = if v_rth_barnum == 111 then v_aggregated_volume_111[1] + volume else if 111 <= v_max_bars_in_rth then v_aggregated_volume_111[1] else Double.NaN;
def v_aggregated_volume_112 = if v_rth_barnum == 112 then v_aggregated_volume_112[1] + volume else if 112 <= v_max_bars_in_rth then v_aggregated_volume_112[1] else Double.NaN;
def v_aggregated_volume_113 = if v_rth_barnum == 113 then v_aggregated_volume_113[1] + volume else if 113 <= v_max_bars_in_rth then v_aggregated_volume_113[1] else Double.NaN;
def v_aggregated_volume_114 = if v_rth_barnum == 114 then v_aggregated_volume_114[1] + volume else if 114 <= v_max_bars_in_rth then v_aggregated_volume_114[1] else Double.NaN;
def v_aggregated_volume_115 = if v_rth_barnum == 115 then v_aggregated_volume_115[1] + volume else if 115 <= v_max_bars_in_rth then v_aggregated_volume_115[1] else Double.NaN;
def v_aggregated_volume_116 = if v_rth_barnum == 116 then v_aggregated_volume_116[1] + volume else if 116 <= v_max_bars_in_rth then v_aggregated_volume_116[1] else Double.NaN;
def v_aggregated_volume_117 = if v_rth_barnum == 117 then v_aggregated_volume_117[1] + volume else if 117 <= v_max_bars_in_rth then v_aggregated_volume_117[1] else Double.NaN;
def v_aggregated_volume_118 = if v_rth_barnum == 118 then v_aggregated_volume_118[1] + volume else if 118 <= v_max_bars_in_rth then v_aggregated_volume_118[1] else Double.NaN;
def v_aggregated_volume_119 = if v_rth_barnum == 119 then v_aggregated_volume_119[1] + volume else if 119 <= v_max_bars_in_rth then v_aggregated_volume_119[1] else Double.NaN;
def v_aggregated_volume_120 = if v_rth_barnum == 120 then v_aggregated_volume_120[1] + volume else if 120 <= v_max_bars_in_rth then v_aggregated_volume_120[1] else Double.NaN;
def v_aggregated_volume_121 = if v_rth_barnum == 121 then v_aggregated_volume_121[1] + volume else if 121 <= v_max_bars_in_rth then v_aggregated_volume_121[1] else Double.NaN;
def v_aggregated_volume_122 = if v_rth_barnum == 122 then v_aggregated_volume_122[1] + volume else if 122 <= v_max_bars_in_rth then v_aggregated_volume_122[1] else Double.NaN;
def v_aggregated_volume_123 = if v_rth_barnum == 123 then v_aggregated_volume_123[1] + volume else if 123 <= v_max_bars_in_rth then v_aggregated_volume_123[1] else Double.NaN;
def v_aggregated_volume_124 = if v_rth_barnum == 124 then v_aggregated_volume_124[1] + volume else if 124 <= v_max_bars_in_rth then v_aggregated_volume_124[1] else Double.NaN;
def v_aggregated_volume_125 = if v_rth_barnum == 125 then v_aggregated_volume_125[1] + volume else if 125 <= v_max_bars_in_rth then v_aggregated_volume_125[1] else Double.NaN;
def v_aggregated_volume_126 = if v_rth_barnum == 126 then v_aggregated_volume_126[1] + volume else if 126 <= v_max_bars_in_rth then v_aggregated_volume_126[1] else Double.NaN;
def v_aggregated_volume_127 = if v_rth_barnum == 127 then v_aggregated_volume_127[1] + volume else if 127 <= v_max_bars_in_rth then v_aggregated_volume_127[1] else Double.NaN;
def v_aggregated_volume_128 = if v_rth_barnum == 128 then v_aggregated_volume_128[1] + volume else if 128 <= v_max_bars_in_rth then v_aggregated_volume_128[1] else Double.NaN;
def v_aggregated_volume_129 = if v_rth_barnum == 129 then v_aggregated_volume_129[1] + volume else if 129 <= v_max_bars_in_rth then v_aggregated_volume_129[1] else Double.NaN;
def v_aggregated_volume_130 = if v_rth_barnum == 130 then v_aggregated_volume_130[1] + volume else if 130 <= v_max_bars_in_rth then v_aggregated_volume_130[1] else Double.NaN;
def v_aggregated_volume_131 = if v_rth_barnum == 131 then v_aggregated_volume_131[1] + volume else if 131 <= v_max_bars_in_rth then v_aggregated_volume_131[1] else Double.NaN;
def v_aggregated_volume_132 = if v_rth_barnum == 132 then v_aggregated_volume_132[1] + volume else if 132 <= v_max_bars_in_rth then v_aggregated_volume_132[1] else Double.NaN;
def v_aggregated_volume_133 = if v_rth_barnum == 133 then v_aggregated_volume_133[1] + volume else if 133 <= v_max_bars_in_rth then v_aggregated_volume_133[1] else Double.NaN;
def v_aggregated_volume_134 = if v_rth_barnum == 134 then v_aggregated_volume_134[1] + volume else if 134 <= v_max_bars_in_rth then v_aggregated_volume_134[1] else Double.NaN;
def v_aggregated_volume_135 = if v_rth_barnum == 135 then v_aggregated_volume_135[1] + volume else if 135 <= v_max_bars_in_rth then v_aggregated_volume_135[1] else Double.NaN;
def v_aggregated_volume_136 = if v_rth_barnum == 136 then v_aggregated_volume_136[1] + volume else if 136 <= v_max_bars_in_rth then v_aggregated_volume_136[1] else Double.NaN;
def v_aggregated_volume_137 = if v_rth_barnum == 137 then v_aggregated_volume_137[1] + volume else if 137 <= v_max_bars_in_rth then v_aggregated_volume_137[1] else Double.NaN;
def v_aggregated_volume_138 = if v_rth_barnum == 138 then v_aggregated_volume_138[1] + volume else if 138 <= v_max_bars_in_rth then v_aggregated_volume_138[1] else Double.NaN;
def v_aggregated_volume_139 = if v_rth_barnum == 139 then v_aggregated_volume_139[1] + volume else if 139 <= v_max_bars_in_rth then v_aggregated_volume_139[1] else Double.NaN;
def v_aggregated_volume_140 = if v_rth_barnum == 140 then v_aggregated_volume_140[1] + volume else if 140 <= v_max_bars_in_rth then v_aggregated_volume_140[1] else Double.NaN;
def v_aggregated_volume_141 = if v_rth_barnum == 141 then v_aggregated_volume_141[1] + volume else if 141 <= v_max_bars_in_rth then v_aggregated_volume_141[1] else Double.NaN;
def v_aggregated_volume_142 = if v_rth_barnum == 142 then v_aggregated_volume_142[1] + volume else if 142 <= v_max_bars_in_rth then v_aggregated_volume_142[1] else Double.NaN;
def v_aggregated_volume_143 = if v_rth_barnum == 143 then v_aggregated_volume_143[1] + volume else if 143 <= v_max_bars_in_rth then v_aggregated_volume_143[1] else Double.NaN;
def v_aggregated_volume_144 = if v_rth_barnum == 144 then v_aggregated_volume_144[1] + volume else if 144 <= v_max_bars_in_rth then v_aggregated_volume_144[1] else Double.NaN;
def v_aggregated_volume_145 = if v_rth_barnum == 145 then v_aggregated_volume_145[1] + volume else if 145 <= v_max_bars_in_rth then v_aggregated_volume_145[1] else Double.NaN;
def v_aggregated_volume_146 = if v_rth_barnum == 146 then v_aggregated_volume_146[1] + volume else if 146 <= v_max_bars_in_rth then v_aggregated_volume_146[1] else Double.NaN;
def v_aggregated_volume_147 = if v_rth_barnum == 147 then v_aggregated_volume_147[1] + volume else if 147 <= v_max_bars_in_rth then v_aggregated_volume_147[1] else Double.NaN;
def v_aggregated_volume_148 = if v_rth_barnum == 148 then v_aggregated_volume_148[1] + volume else if 148 <= v_max_bars_in_rth then v_aggregated_volume_148[1] else Double.NaN;
def v_aggregated_volume_149 = if v_rth_barnum == 149 then v_aggregated_volume_149[1] + volume else if 149 <= v_max_bars_in_rth then v_aggregated_volume_149[1] else Double.NaN;
def v_aggregated_volume_150 = if v_rth_barnum == 150 then v_aggregated_volume_150[1] + volume else if 150 <= v_max_bars_in_rth then v_aggregated_volume_150[1] else Double.NaN;
def v_aggregated_volume_151 = if v_rth_barnum == 151 then v_aggregated_volume_151[1] + volume else if 151 <= v_max_bars_in_rth then v_aggregated_volume_151[1] else Double.NaN;
def v_aggregated_volume_152 = if v_rth_barnum == 152 then v_aggregated_volume_152[1] + volume else if 152 <= v_max_bars_in_rth then v_aggregated_volume_152[1] else Double.NaN;
def v_aggregated_volume_153 = if v_rth_barnum == 153 then v_aggregated_volume_153[1] + volume else if 153 <= v_max_bars_in_rth then v_aggregated_volume_153[1] else Double.NaN;
def v_aggregated_volume_154 = if v_rth_barnum == 154 then v_aggregated_volume_154[1] + volume else if 154 <= v_max_bars_in_rth then v_aggregated_volume_154[1] else Double.NaN;
def v_aggregated_volume_155 = if v_rth_barnum == 155 then v_aggregated_volume_155[1] + volume else if 155 <= v_max_bars_in_rth then v_aggregated_volume_155[1] else Double.NaN;
def v_aggregated_volume_156 = if v_rth_barnum == 156 then v_aggregated_volume_156[1] + volume else if 156 <= v_max_bars_in_rth then v_aggregated_volume_156[1] else Double.NaN;
def v_aggregated_volume_157 = if v_rth_barnum == 157 then v_aggregated_volume_157[1] + volume else if 157 <= v_max_bars_in_rth then v_aggregated_volume_157[1] else Double.NaN;
def v_aggregated_volume_158 = if v_rth_barnum == 158 then v_aggregated_volume_158[1] + volume else if 158 <= v_max_bars_in_rth then v_aggregated_volume_158[1] else Double.NaN;
def v_aggregated_volume_159 = if v_rth_barnum == 159 then v_aggregated_volume_159[1] + volume else if 159 <= v_max_bars_in_rth then v_aggregated_volume_159[1] else Double.NaN;
def v_aggregated_volume_160 = if v_rth_barnum == 160 then v_aggregated_volume_160[1] + volume else if 160 <= v_max_bars_in_rth then v_aggregated_volume_160[1] else Double.NaN;
def v_aggregated_volume_161 = if v_rth_barnum == 161 then v_aggregated_volume_161[1] + volume else if 161 <= v_max_bars_in_rth then v_aggregated_volume_161[1] else Double.NaN;
def v_aggregated_volume_162 = if v_rth_barnum == 162 then v_aggregated_volume_162[1] + volume else if 162 <= v_max_bars_in_rth then v_aggregated_volume_162[1] else Double.NaN;
def v_aggregated_volume_163 = if v_rth_barnum == 163 then v_aggregated_volume_163[1] + volume else if 163 <= v_max_bars_in_rth then v_aggregated_volume_163[1] else Double.NaN;
def v_aggregated_volume_164 = if v_rth_barnum == 164 then v_aggregated_volume_164[1] + volume else if 164 <= v_max_bars_in_rth then v_aggregated_volume_164[1] else Double.NaN;
def v_aggregated_volume_165 = if v_rth_barnum == 165 then v_aggregated_volume_165[1] + volume else if 165 <= v_max_bars_in_rth then v_aggregated_volume_165[1] else Double.NaN;
def v_aggregated_volume_166 = if v_rth_barnum == 166 then v_aggregated_volume_166[1] + volume else if 166 <= v_max_bars_in_rth then v_aggregated_volume_166[1] else Double.NaN;
def v_aggregated_volume_167 = if v_rth_barnum == 167 then v_aggregated_volume_167[1] + volume else if 167 <= v_max_bars_in_rth then v_aggregated_volume_167[1] else Double.NaN;
def v_aggregated_volume_168 = if v_rth_barnum == 168 then v_aggregated_volume_168[1] + volume else if 168 <= v_max_bars_in_rth then v_aggregated_volume_168[1] else Double.NaN;
def v_aggregated_volume_169 = if v_rth_barnum == 169 then v_aggregated_volume_169[1] + volume else if 169 <= v_max_bars_in_rth then v_aggregated_volume_169[1] else Double.NaN;
def v_aggregated_volume_170 = if v_rth_barnum == 170 then v_aggregated_volume_170[1] + volume else if 170 <= v_max_bars_in_rth then v_aggregated_volume_170[1] else Double.NaN;
def v_aggregated_volume_171 = if v_rth_barnum == 171 then v_aggregated_volume_171[1] + volume else if 171 <= v_max_bars_in_rth then v_aggregated_volume_171[1] else Double.NaN;
def v_aggregated_volume_172 = if v_rth_barnum == 172 then v_aggregated_volume_172[1] + volume else if 172 <= v_max_bars_in_rth then v_aggregated_volume_172[1] else Double.NaN;
def v_aggregated_volume_173 = if v_rth_barnum == 173 then v_aggregated_volume_173[1] + volume else if 173 <= v_max_bars_in_rth then v_aggregated_volume_173[1] else Double.NaN;
def v_aggregated_volume_174 = if v_rth_barnum == 174 then v_aggregated_volume_174[1] + volume else if 174 <= v_max_bars_in_rth then v_aggregated_volume_174[1] else Double.NaN;
def v_aggregated_volume_175 = if v_rth_barnum == 175 then v_aggregated_volume_175[1] + volume else if 175 <= v_max_bars_in_rth then v_aggregated_volume_175[1] else Double.NaN;
def v_aggregated_volume_176 = if v_rth_barnum == 176 then v_aggregated_volume_176[1] + volume else if 176 <= v_max_bars_in_rth then v_aggregated_volume_176[1] else Double.NaN;
def v_aggregated_volume_177 = if v_rth_barnum == 177 then v_aggregated_volume_177[1] + volume else if 177 <= v_max_bars_in_rth then v_aggregated_volume_177[1] else Double.NaN;
def v_aggregated_volume_178 = if v_rth_barnum == 178 then v_aggregated_volume_178[1] + volume else if 178 <= v_max_bars_in_rth then v_aggregated_volume_178[1] else Double.NaN;
def v_aggregated_volume_179 = if v_rth_barnum == 179 then v_aggregated_volume_179[1] + volume else if 179 <= v_max_bars_in_rth then v_aggregated_volume_179[1] else Double.NaN;
def v_aggregated_volume_180 = if v_rth_barnum == 180 then v_aggregated_volume_180[1] + volume else if 180 <= v_max_bars_in_rth then v_aggregated_volume_180[1] else Double.NaN;
def v_aggregated_volume_181 = if v_rth_barnum == 181 then v_aggregated_volume_181[1] + volume else if 181 <= v_max_bars_in_rth then v_aggregated_volume_181[1] else Double.NaN;
def v_aggregated_volume_182 = if v_rth_barnum == 182 then v_aggregated_volume_182[1] + volume else if 182 <= v_max_bars_in_rth then v_aggregated_volume_182[1] else Double.NaN;
def v_aggregated_volume_183 = if v_rth_barnum == 183 then v_aggregated_volume_183[1] + volume else if 183 <= v_max_bars_in_rth then v_aggregated_volume_183[1] else Double.NaN;
def v_aggregated_volume_184 = if v_rth_barnum == 184 then v_aggregated_volume_184[1] + volume else if 184 <= v_max_bars_in_rth then v_aggregated_volume_184[1] else Double.NaN;
def v_aggregated_volume_185 = if v_rth_barnum == 185 then v_aggregated_volume_185[1] + volume else if 185 <= v_max_bars_in_rth then v_aggregated_volume_185[1] else Double.NaN;
def v_aggregated_volume_186 = if v_rth_barnum == 186 then v_aggregated_volume_186[1] + volume else if 186 <= v_max_bars_in_rth then v_aggregated_volume_186[1] else Double.NaN;
def v_aggregated_volume_187 = if v_rth_barnum == 187 then v_aggregated_volume_187[1] + volume else if 187 <= v_max_bars_in_rth then v_aggregated_volume_187[1] else Double.NaN;
def v_aggregated_volume_188 = if v_rth_barnum == 188 then v_aggregated_volume_188[1] + volume else if 188 <= v_max_bars_in_rth then v_aggregated_volume_188[1] else Double.NaN;
def v_aggregated_volume_189 = if v_rth_barnum == 189 then v_aggregated_volume_189[1] + volume else if 189 <= v_max_bars_in_rth then v_aggregated_volume_189[1] else Double.NaN;
def v_aggregated_volume_190 = if v_rth_barnum == 190 then v_aggregated_volume_190[1] + volume else if 190 <= v_max_bars_in_rth then v_aggregated_volume_190[1] else Double.NaN;
def v_aggregated_volume_191 = if v_rth_barnum == 191 then v_aggregated_volume_191[1] + volume else if 191 <= v_max_bars_in_rth then v_aggregated_volume_191[1] else Double.NaN;
def v_aggregated_volume_192 = if v_rth_barnum == 192 then v_aggregated_volume_192[1] + volume else if 192 <= v_max_bars_in_rth then v_aggregated_volume_192[1] else Double.NaN;
def v_aggregated_volume_193 = if v_rth_barnum == 193 then v_aggregated_volume_193[1] + volume else if 193 <= v_max_bars_in_rth then v_aggregated_volume_193[1] else Double.NaN;
def v_aggregated_volume_194 = if v_rth_barnum == 194 then v_aggregated_volume_194[1] + volume else if 194 <= v_max_bars_in_rth then v_aggregated_volume_194[1] else Double.NaN;
def v_aggregated_volume_195 = if v_rth_barnum == 195 then v_aggregated_volume_195[1] + volume else if 195 <= v_max_bars_in_rth then v_aggregated_volume_195[1] else Double.NaN;
def v_aggregated_volume_196 = if v_rth_barnum == 196 then v_aggregated_volume_196[1] + volume else if 196 <= v_max_bars_in_rth then v_aggregated_volume_196[1] else Double.NaN;
def v_aggregated_volume_197 = if v_rth_barnum == 197 then v_aggregated_volume_197[1] + volume else if 197 <= v_max_bars_in_rth then v_aggregated_volume_197[1] else Double.NaN;
def v_aggregated_volume_198 = if v_rth_barnum == 198 then v_aggregated_volume_198[1] + volume else if 198 <= v_max_bars_in_rth then v_aggregated_volume_198[1] else Double.NaN;
def v_aggregated_volume_199 = if v_rth_barnum == 199 then v_aggregated_volume_199[1] + volume else if 199 <= v_max_bars_in_rth then v_aggregated_volume_199[1] else Double.NaN;
def v_aggregated_volume_200 = if v_rth_barnum == 200 then v_aggregated_volume_200[1] + volume else if 200 <= v_max_bars_in_rth then v_aggregated_volume_200[1] else Double.NaN;
def v_aggregated_volume_201 = if v_rth_barnum == 201 then v_aggregated_volume_201[1] + volume else if 201 <= v_max_bars_in_rth then v_aggregated_volume_201[1] else Double.NaN;
def v_aggregated_volume_202 = if v_rth_barnum == 202 then v_aggregated_volume_202[1] + volume else if 202 <= v_max_bars_in_rth then v_aggregated_volume_202[1] else Double.NaN;
def v_aggregated_volume_203 = if v_rth_barnum == 203 then v_aggregated_volume_203[1] + volume else if 203 <= v_max_bars_in_rth then v_aggregated_volume_203[1] else Double.NaN;


def v_avg_volume_001 = v_aggregated_volume_001/(if v_rth_barnum >= 1 then v_days else v_days_divisor);
def v_avg_volume_002 = v_aggregated_volume_002/(if v_rth_barnum >= 2 then v_days else v_days_divisor);
def v_avg_volume_003 = v_aggregated_volume_003/(if v_rth_barnum >= 3 then v_days else v_days_divisor);
def v_avg_volume_004 = v_aggregated_volume_004/(if v_rth_barnum >= 4 then v_days else v_days_divisor);
def v_avg_volume_005 = v_aggregated_volume_005/(if v_rth_barnum >= 5 then v_days else v_days_divisor);
def v_avg_volume_006 = v_aggregated_volume_006/(if v_rth_barnum >= 6 then v_days else v_days_divisor);
def v_avg_volume_007 = v_aggregated_volume_007/(if v_rth_barnum >= 7 then v_days else v_days_divisor);
def v_avg_volume_008 = v_aggregated_volume_008/(if v_rth_barnum >= 8 then v_days else v_days_divisor);
def v_avg_volume_009 = v_aggregated_volume_009/(if v_rth_barnum >= 9 then v_days else v_days_divisor);
def v_avg_volume_010 = v_aggregated_volume_010/(if v_rth_barnum >= 10 then v_days else v_days_divisor);
def v_avg_volume_011 = v_aggregated_volume_011/(if v_rth_barnum >= 11 then v_days else v_days_divisor);
def v_avg_volume_012 = v_aggregated_volume_012/(if v_rth_barnum >= 12 then v_days else v_days_divisor);
def v_avg_volume_013 = v_aggregated_volume_013/(if v_rth_barnum >= 13 then v_days else v_days_divisor);
def v_avg_volume_014 = v_aggregated_volume_014/(if v_rth_barnum >= 14 then v_days else v_days_divisor);
def v_avg_volume_015 = v_aggregated_volume_015/(if v_rth_barnum >= 15 then v_days else v_days_divisor);
def v_avg_volume_016 = v_aggregated_volume_016/(if v_rth_barnum >= 16 then v_days else v_days_divisor);
def v_avg_volume_017 = v_aggregated_volume_017/(if v_rth_barnum >= 17 then v_days else v_days_divisor);
def v_avg_volume_018 = v_aggregated_volume_018/(if v_rth_barnum >= 18 then v_days else v_days_divisor);
def v_avg_volume_019 = v_aggregated_volume_019/(if v_rth_barnum >= 19 then v_days else v_days_divisor);
def v_avg_volume_020 = v_aggregated_volume_020/(if v_rth_barnum >= 20 then v_days else v_days_divisor);
def v_avg_volume_021 = v_aggregated_volume_021/(if v_rth_barnum >= 21 then v_days else v_days_divisor);
def v_avg_volume_022 = v_aggregated_volume_022/(if v_rth_barnum >= 22 then v_days else v_days_divisor);
def v_avg_volume_023 = v_aggregated_volume_023/(if v_rth_barnum >= 23 then v_days else v_days_divisor);
def v_avg_volume_024 = v_aggregated_volume_024/(if v_rth_barnum >= 24 then v_days else v_days_divisor);
def v_avg_volume_025 = v_aggregated_volume_025/(if v_rth_barnum >= 25 then v_days else v_days_divisor);
def v_avg_volume_026 = v_aggregated_volume_026/(if v_rth_barnum >= 26 then v_days else v_days_divisor);
def v_avg_volume_027 = v_aggregated_volume_027/(if v_rth_barnum >= 27 then v_days else v_days_divisor);
def v_avg_volume_028 = v_aggregated_volume_028/(if v_rth_barnum >= 28 then v_days else v_days_divisor);
def v_avg_volume_029 = v_aggregated_volume_029/(if v_rth_barnum >= 29 then v_days else v_days_divisor);
def v_avg_volume_030 = v_aggregated_volume_030/(if v_rth_barnum >= 30 then v_days else v_days_divisor);
def v_avg_volume_031 = v_aggregated_volume_031/(if v_rth_barnum >= 31 then v_days else v_days_divisor);
def v_avg_volume_032 = v_aggregated_volume_032/(if v_rth_barnum >= 32 then v_days else v_days_divisor);
def v_avg_volume_033 = v_aggregated_volume_033/(if v_rth_barnum >= 33 then v_days else v_days_divisor);
def v_avg_volume_034 = v_aggregated_volume_034/(if v_rth_barnum >= 34 then v_days else v_days_divisor);
def v_avg_volume_035 = v_aggregated_volume_035/(if v_rth_barnum >= 35 then v_days else v_days_divisor);
def v_avg_volume_036 = v_aggregated_volume_036/(if v_rth_barnum >= 36 then v_days else v_days_divisor);
def v_avg_volume_037 = v_aggregated_volume_037/(if v_rth_barnum >= 37 then v_days else v_days_divisor);
def v_avg_volume_038 = v_aggregated_volume_038/(if v_rth_barnum >= 38 then v_days else v_days_divisor);
def v_avg_volume_039 = v_aggregated_volume_039/(if v_rth_barnum >= 39 then v_days else v_days_divisor);
def v_avg_volume_040 = v_aggregated_volume_040/(if v_rth_barnum >= 40 then v_days else v_days_divisor);
def v_avg_volume_041 = v_aggregated_volume_041/(if v_rth_barnum >= 41 then v_days else v_days_divisor);
def v_avg_volume_042 = v_aggregated_volume_042/(if v_rth_barnum >= 42 then v_days else v_days_divisor);
def v_avg_volume_043 = v_aggregated_volume_043/(if v_rth_barnum >= 43 then v_days else v_days_divisor);
def v_avg_volume_044 = v_aggregated_volume_044/(if v_rth_barnum >= 44 then v_days else v_days_divisor);
def v_avg_volume_045 = v_aggregated_volume_045/(if v_rth_barnum >= 45 then v_days else v_days_divisor);
def v_avg_volume_046 = v_aggregated_volume_046/(if v_rth_barnum >= 46 then v_days else v_days_divisor);
def v_avg_volume_047 = v_aggregated_volume_047/(if v_rth_barnum >= 47 then v_days else v_days_divisor);
def v_avg_volume_048 = v_aggregated_volume_048/(if v_rth_barnum >= 48 then v_days else v_days_divisor);
def v_avg_volume_049 = v_aggregated_volume_049/(if v_rth_barnum >= 49 then v_days else v_days_divisor);
def v_avg_volume_050 = v_aggregated_volume_050/(if v_rth_barnum >= 50 then v_days else v_days_divisor);
def v_avg_volume_051 = v_aggregated_volume_051/(if v_rth_barnum >= 51 then v_days else v_days_divisor);
def v_avg_volume_052 = v_aggregated_volume_052/(if v_rth_barnum >= 52 then v_days else v_days_divisor);
def v_avg_volume_053 = v_aggregated_volume_053/(if v_rth_barnum >= 53 then v_days else v_days_divisor);
def v_avg_volume_054 = v_aggregated_volume_054/(if v_rth_barnum >= 54 then v_days else v_days_divisor);
def v_avg_volume_055 = v_aggregated_volume_055/(if v_rth_barnum >= 55 then v_days else v_days_divisor);
def v_avg_volume_056 = v_aggregated_volume_056/(if v_rth_barnum >= 56 then v_days else v_days_divisor);
def v_avg_volume_057 = v_aggregated_volume_057/(if v_rth_barnum >= 57 then v_days else v_days_divisor);
def v_avg_volume_058 = v_aggregated_volume_058/(if v_rth_barnum >= 58 then v_days else v_days_divisor);
def v_avg_volume_059 = v_aggregated_volume_059/(if v_rth_barnum >= 59 then v_days else v_days_divisor);
def v_avg_volume_060 = v_aggregated_volume_060/(if v_rth_barnum >= 60 then v_days else v_days_divisor);
def v_avg_volume_061 = v_aggregated_volume_061/(if v_rth_barnum >= 61 then v_days else v_days_divisor);
def v_avg_volume_062 = v_aggregated_volume_062/(if v_rth_barnum >= 62 then v_days else v_days_divisor);
def v_avg_volume_063 = v_aggregated_volume_063/(if v_rth_barnum >= 63 then v_days else v_days_divisor);
def v_avg_volume_064 = v_aggregated_volume_064/(if v_rth_barnum >= 64 then v_days else v_days_divisor);
def v_avg_volume_065 = v_aggregated_volume_065/(if v_rth_barnum >= 65 then v_days else v_days_divisor);
def v_avg_volume_066 = v_aggregated_volume_066/(if v_rth_barnum >= 66 then v_days else v_days_divisor);
def v_avg_volume_067 = v_aggregated_volume_067/(if v_rth_barnum >= 67 then v_days else v_days_divisor);
def v_avg_volume_068 = v_aggregated_volume_068/(if v_rth_barnum >= 68 then v_days else v_days_divisor);
def v_avg_volume_069 = v_aggregated_volume_069/(if v_rth_barnum >= 69 then v_days else v_days_divisor);
def v_avg_volume_070 = v_aggregated_volume_070/(if v_rth_barnum >= 70 then v_days else v_days_divisor);
def v_avg_volume_071 = v_aggregated_volume_071/(if v_rth_barnum >= 71 then v_days else v_days_divisor);
def v_avg_volume_072 = v_aggregated_volume_072/(if v_rth_barnum >= 72 then v_days else v_days_divisor);
def v_avg_volume_073 = v_aggregated_volume_073/(if v_rth_barnum >= 73 then v_days else v_days_divisor);
def v_avg_volume_074 = v_aggregated_volume_074/(if v_rth_barnum >= 74 then v_days else v_days_divisor);
def v_avg_volume_075 = v_aggregated_volume_075/(if v_rth_barnum >= 75 then v_days else v_days_divisor);
def v_avg_volume_076 = v_aggregated_volume_076/(if v_rth_barnum >= 76 then v_days else v_days_divisor);
def v_avg_volume_077 = v_aggregated_volume_077/(if v_rth_barnum >= 77 then v_days else v_days_divisor);
def v_avg_volume_078 = v_aggregated_volume_078/(if v_rth_barnum >= 78 then v_days else v_days_divisor);
def v_avg_volume_079 = v_aggregated_volume_079/(if v_rth_barnum >= 79 then v_days else v_days_divisor);
def v_avg_volume_080 = v_aggregated_volume_080/(if v_rth_barnum >= 80 then v_days else v_days_divisor);
def v_avg_volume_081 = v_aggregated_volume_081/(if v_rth_barnum >= 81 then v_days else v_days_divisor);
def v_avg_volume_082 = v_aggregated_volume_082/(if v_rth_barnum >= 82 then v_days else v_days_divisor);
def v_avg_volume_083 = v_aggregated_volume_083/(if v_rth_barnum >= 83 then v_days else v_days_divisor);
def v_avg_volume_084 = v_aggregated_volume_084/(if v_rth_barnum >= 84 then v_days else v_days_divisor);
def v_avg_volume_085 = v_aggregated_volume_085/(if v_rth_barnum >= 85 then v_days else v_days_divisor);
def v_avg_volume_086 = v_aggregated_volume_086/(if v_rth_barnum >= 86 then v_days else v_days_divisor);
def v_avg_volume_087 = v_aggregated_volume_087/(if v_rth_barnum >= 87 then v_days else v_days_divisor);
def v_avg_volume_088 = v_aggregated_volume_088/(if v_rth_barnum >= 88 then v_days else v_days_divisor);
def v_avg_volume_089 = v_aggregated_volume_089/(if v_rth_barnum >= 89 then v_days else v_days_divisor);
def v_avg_volume_090 = v_aggregated_volume_090/(if v_rth_barnum >= 90 then v_days else v_days_divisor);
def v_avg_volume_091 = v_aggregated_volume_091/(if v_rth_barnum >= 91 then v_days else v_days_divisor);
def v_avg_volume_092 = v_aggregated_volume_092/(if v_rth_barnum >= 92 then v_days else v_days_divisor);
def v_avg_volume_093 = v_aggregated_volume_093/(if v_rth_barnum >= 93 then v_days else v_days_divisor);
def v_avg_volume_094 = v_aggregated_volume_094/(if v_rth_barnum >= 94 then v_days else v_days_divisor);
def v_avg_volume_095 = v_aggregated_volume_095/(if v_rth_barnum >= 95 then v_days else v_days_divisor);
def v_avg_volume_096 = v_aggregated_volume_096/(if v_rth_barnum >= 96 then v_days else v_days_divisor);
def v_avg_volume_097 = v_aggregated_volume_097/(if v_rth_barnum >= 97 then v_days else v_days_divisor);
def v_avg_volume_098 = v_aggregated_volume_098/(if v_rth_barnum >= 98 then v_days else v_days_divisor);
def v_avg_volume_099 = v_aggregated_volume_099/(if v_rth_barnum >= 99 then v_days else v_days_divisor);
def v_avg_volume_100 = v_aggregated_volume_100/(if v_rth_barnum >= 100 then v_days else v_days_divisor);
def v_avg_volume_101 = v_aggregated_volume_101/(if v_rth_barnum >= 101 then v_days else v_days_divisor);
def v_avg_volume_102 = v_aggregated_volume_102/(if v_rth_barnum >= 102 then v_days else v_days_divisor);
def v_avg_volume_103 = v_aggregated_volume_103/(if v_rth_barnum >= 103 then v_days else v_days_divisor);
def v_avg_volume_104 = v_aggregated_volume_104/(if v_rth_barnum >= 104 then v_days else v_days_divisor);
def v_avg_volume_105 = v_aggregated_volume_105/(if v_rth_barnum >= 105 then v_days else v_days_divisor);
def v_avg_volume_106 = v_aggregated_volume_106/(if v_rth_barnum >= 106 then v_days else v_days_divisor);
def v_avg_volume_107 = v_aggregated_volume_107/(if v_rth_barnum >= 107 then v_days else v_days_divisor);
def v_avg_volume_108 = v_aggregated_volume_108/(if v_rth_barnum >= 108 then v_days else v_days_divisor);
def v_avg_volume_109 = v_aggregated_volume_109/(if v_rth_barnum >= 109 then v_days else v_days_divisor);
def v_avg_volume_110 = v_aggregated_volume_110/(if v_rth_barnum >= 110 then v_days else v_days_divisor);
def v_avg_volume_111 = v_aggregated_volume_111/(if v_rth_barnum >= 111 then v_days else v_days_divisor);
def v_avg_volume_112 = v_aggregated_volume_112/(if v_rth_barnum >= 112 then v_days else v_days_divisor);
def v_avg_volume_113 = v_aggregated_volume_113/(if v_rth_barnum >= 113 then v_days else v_days_divisor);
def v_avg_volume_114 = v_aggregated_volume_114/(if v_rth_barnum >= 114 then v_days else v_days_divisor);
def v_avg_volume_115 = v_aggregated_volume_115/(if v_rth_barnum >= 115 then v_days else v_days_divisor);
def v_avg_volume_116 = v_aggregated_volume_116/(if v_rth_barnum >= 116 then v_days else v_days_divisor);
def v_avg_volume_117 = v_aggregated_volume_117/(if v_rth_barnum >= 117 then v_days else v_days_divisor);
def v_avg_volume_118 = v_aggregated_volume_118/(if v_rth_barnum >= 118 then v_days else v_days_divisor);
def v_avg_volume_119 = v_aggregated_volume_119/(if v_rth_barnum >= 119 then v_days else v_days_divisor);
def v_avg_volume_120 = v_aggregated_volume_120/(if v_rth_barnum >= 120 then v_days else v_days_divisor);
def v_avg_volume_121 = v_aggregated_volume_121/(if v_rth_barnum >= 121 then v_days else v_days_divisor);
def v_avg_volume_122 = v_aggregated_volume_122/(if v_rth_barnum >= 122 then v_days else v_days_divisor);
def v_avg_volume_123 = v_aggregated_volume_123/(if v_rth_barnum >= 123 then v_days else v_days_divisor);
def v_avg_volume_124 = v_aggregated_volume_124/(if v_rth_barnum >= 124 then v_days else v_days_divisor);
def v_avg_volume_125 = v_aggregated_volume_125/(if v_rth_barnum >= 125 then v_days else v_days_divisor);
def v_avg_volume_126 = v_aggregated_volume_126/(if v_rth_barnum >= 126 then v_days else v_days_divisor);
def v_avg_volume_127 = v_aggregated_volume_127/(if v_rth_barnum >= 127 then v_days else v_days_divisor);
def v_avg_volume_128 = v_aggregated_volume_128/(if v_rth_barnum >= 128 then v_days else v_days_divisor);
def v_avg_volume_129 = v_aggregated_volume_129/(if v_rth_barnum >= 129 then v_days else v_days_divisor);
def v_avg_volume_130 = v_aggregated_volume_130/(if v_rth_barnum >= 130 then v_days else v_days_divisor);
def v_avg_volume_131 = v_aggregated_volume_131/(if v_rth_barnum >= 131 then v_days else v_days_divisor);
def v_avg_volume_132 = v_aggregated_volume_132/(if v_rth_barnum >= 132 then v_days else v_days_divisor);
def v_avg_volume_133 = v_aggregated_volume_133/(if v_rth_barnum >= 133 then v_days else v_days_divisor);
def v_avg_volume_134 = v_aggregated_volume_134/(if v_rth_barnum >= 134 then v_days else v_days_divisor);
def v_avg_volume_135 = v_aggregated_volume_135/(if v_rth_barnum >= 135 then v_days else v_days_divisor);
def v_avg_volume_136 = v_aggregated_volume_136/(if v_rth_barnum >= 136 then v_days else v_days_divisor);
def v_avg_volume_137 = v_aggregated_volume_137/(if v_rth_barnum >= 137 then v_days else v_days_divisor);
def v_avg_volume_138 = v_aggregated_volume_138/(if v_rth_barnum >= 138 then v_days else v_days_divisor);
def v_avg_volume_139 = v_aggregated_volume_139/(if v_rth_barnum >= 139 then v_days else v_days_divisor);
def v_avg_volume_140 = v_aggregated_volume_140/(if v_rth_barnum >= 140 then v_days else v_days_divisor);
def v_avg_volume_141 = v_aggregated_volume_141/(if v_rth_barnum >= 141 then v_days else v_days_divisor);
def v_avg_volume_142 = v_aggregated_volume_142/(if v_rth_barnum >= 142 then v_days else v_days_divisor);
def v_avg_volume_143 = v_aggregated_volume_143/(if v_rth_barnum >= 143 then v_days else v_days_divisor);
def v_avg_volume_144 = v_aggregated_volume_144/(if v_rth_barnum >= 144 then v_days else v_days_divisor);
def v_avg_volume_145 = v_aggregated_volume_145/(if v_rth_barnum >= 145 then v_days else v_days_divisor);
def v_avg_volume_146 = v_aggregated_volume_146/(if v_rth_barnum >= 146 then v_days else v_days_divisor);
def v_avg_volume_147 = v_aggregated_volume_147/(if v_rth_barnum >= 147 then v_days else v_days_divisor);
def v_avg_volume_148 = v_aggregated_volume_148/(if v_rth_barnum >= 148 then v_days else v_days_divisor);
def v_avg_volume_149 = v_aggregated_volume_149/(if v_rth_barnum >= 149 then v_days else v_days_divisor);
def v_avg_volume_150 = v_aggregated_volume_150/(if v_rth_barnum >= 150 then v_days else v_days_divisor);
def v_avg_volume_151 = v_aggregated_volume_151/(if v_rth_barnum >= 151 then v_days else v_days_divisor);
def v_avg_volume_152 = v_aggregated_volume_152/(if v_rth_barnum >= 152 then v_days else v_days_divisor);
def v_avg_volume_153 = v_aggregated_volume_153/(if v_rth_barnum >= 153 then v_days else v_days_divisor);
def v_avg_volume_154 = v_aggregated_volume_154/(if v_rth_barnum >= 154 then v_days else v_days_divisor);
def v_avg_volume_155 = v_aggregated_volume_155/(if v_rth_barnum >= 155 then v_days else v_days_divisor);
def v_avg_volume_156 = v_aggregated_volume_156/(if v_rth_barnum >= 156 then v_days else v_days_divisor);
def v_avg_volume_157 = v_aggregated_volume_157/(if v_rth_barnum >= 157 then v_days else v_days_divisor);
def v_avg_volume_158 = v_aggregated_volume_158/(if v_rth_barnum >= 158 then v_days else v_days_divisor);
def v_avg_volume_159 = v_aggregated_volume_159/(if v_rth_barnum >= 159 then v_days else v_days_divisor);
def v_avg_volume_160 = v_aggregated_volume_160/(if v_rth_barnum >= 160 then v_days else v_days_divisor);
def v_avg_volume_161 = v_aggregated_volume_161/(if v_rth_barnum >= 161 then v_days else v_days_divisor);
def v_avg_volume_162 = v_aggregated_volume_162/(if v_rth_barnum >= 162 then v_days else v_days_divisor);
def v_avg_volume_163 = v_aggregated_volume_163/(if v_rth_barnum >= 163 then v_days else v_days_divisor);
def v_avg_volume_164 = v_aggregated_volume_164/(if v_rth_barnum >= 164 then v_days else v_days_divisor);
def v_avg_volume_165 = v_aggregated_volume_165/(if v_rth_barnum >= 165 then v_days else v_days_divisor);
def v_avg_volume_166 = v_aggregated_volume_166/(if v_rth_barnum >= 166 then v_days else v_days_divisor);
def v_avg_volume_167 = v_aggregated_volume_167/(if v_rth_barnum >= 167 then v_days else v_days_divisor);
def v_avg_volume_168 = v_aggregated_volume_168/(if v_rth_barnum >= 168 then v_days else v_days_divisor);
def v_avg_volume_169 = v_aggregated_volume_169/(if v_rth_barnum >= 169 then v_days else v_days_divisor);
def v_avg_volume_170 = v_aggregated_volume_170/(if v_rth_barnum >= 170 then v_days else v_days_divisor);
def v_avg_volume_171 = v_aggregated_volume_171/(if v_rth_barnum >= 171 then v_days else v_days_divisor);
def v_avg_volume_172 = v_aggregated_volume_172/(if v_rth_barnum >= 172 then v_days else v_days_divisor);
def v_avg_volume_173 = v_aggregated_volume_173/(if v_rth_barnum >= 173 then v_days else v_days_divisor);
def v_avg_volume_174 = v_aggregated_volume_174/(if v_rth_barnum >= 174 then v_days else v_days_divisor);
def v_avg_volume_175 = v_aggregated_volume_175/(if v_rth_barnum >= 175 then v_days else v_days_divisor);
def v_avg_volume_176 = v_aggregated_volume_176/(if v_rth_barnum >= 176 then v_days else v_days_divisor);
def v_avg_volume_177 = v_aggregated_volume_177/(if v_rth_barnum >= 177 then v_days else v_days_divisor);
def v_avg_volume_178 = v_aggregated_volume_178/(if v_rth_barnum >= 178 then v_days else v_days_divisor);
def v_avg_volume_179 = v_aggregated_volume_179/(if v_rth_barnum >= 179 then v_days else v_days_divisor);
def v_avg_volume_180 = v_aggregated_volume_180/(if v_rth_barnum >= 180 then v_days else v_days_divisor);
def v_avg_volume_181 = v_aggregated_volume_181/(if v_rth_barnum >= 181 then v_days else v_days_divisor);
def v_avg_volume_182 = v_aggregated_volume_182/(if v_rth_barnum >= 182 then v_days else v_days_divisor);
def v_avg_volume_183 = v_aggregated_volume_183/(if v_rth_barnum >= 183 then v_days else v_days_divisor);
def v_avg_volume_184 = v_aggregated_volume_184/(if v_rth_barnum >= 184 then v_days else v_days_divisor);
def v_avg_volume_185 = v_aggregated_volume_185/(if v_rth_barnum >= 185 then v_days else v_days_divisor);
def v_avg_volume_186 = v_aggregated_volume_186/(if v_rth_barnum >= 186 then v_days else v_days_divisor);
def v_avg_volume_187 = v_aggregated_volume_187/(if v_rth_barnum >= 187 then v_days else v_days_divisor);
def v_avg_volume_188 = v_aggregated_volume_188/(if v_rth_barnum >= 188 then v_days else v_days_divisor);
def v_avg_volume_189 = v_aggregated_volume_189/(if v_rth_barnum >= 189 then v_days else v_days_divisor);
def v_avg_volume_190 = v_aggregated_volume_190/(if v_rth_barnum >= 190 then v_days else v_days_divisor);
def v_avg_volume_191 = v_aggregated_volume_191/(if v_rth_barnum >= 191 then v_days else v_days_divisor);
def v_avg_volume_192 = v_aggregated_volume_192/(if v_rth_barnum >= 192 then v_days else v_days_divisor);
def v_avg_volume_193 = v_aggregated_volume_193/(if v_rth_barnum >= 193 then v_days else v_days_divisor);
def v_avg_volume_194 = v_aggregated_volume_194/(if v_rth_barnum >= 194 then v_days else v_days_divisor);
def v_avg_volume_195 = v_aggregated_volume_195/(if v_rth_barnum >= 195 then v_days else v_days_divisor);
def v_avg_volume_196 = v_aggregated_volume_196/(if v_rth_barnum >= 196 then v_days else v_days_divisor);
def v_avg_volume_197 = v_aggregated_volume_197/(if v_rth_barnum >= 197 then v_days else v_days_divisor);
def v_avg_volume_198 = v_aggregated_volume_198/(if v_rth_barnum >= 198 then v_days else v_days_divisor);
def v_avg_volume_199 = v_aggregated_volume_199/(if v_rth_barnum >= 199 then v_days else v_days_divisor);
def v_avg_volume_200 = v_aggregated_volume_200/(if v_rth_barnum >= 200 then v_days else v_days_divisor);
def v_avg_volume_201 = v_aggregated_volume_201/(if v_rth_barnum >= 201 then v_days else v_days_divisor);
def v_avg_volume_202 = v_aggregated_volume_202/(if v_rth_barnum >= 202 then v_days else v_days_divisor);
def v_avg_volume_203 = v_aggregated_volume_203/(if v_rth_barnum >= 203 then v_days else v_days_divisor);

def v_avg_bar_volume =
     if v_rth_barnum == 1 then v_avg_volume_001
else if v_rth_barnum == 2 then v_avg_volume_002
else if v_rth_barnum == 3 then v_avg_volume_003
else if v_rth_barnum == 4 then v_avg_volume_004
else if v_rth_barnum == 5 then v_avg_volume_005
else if v_rth_barnum == 6 then v_avg_volume_006
else if v_rth_barnum == 7 then v_avg_volume_007
else if v_rth_barnum == 8 then v_avg_volume_008
else if v_rth_barnum == 9 then v_avg_volume_009
else if v_rth_barnum == 10 then v_avg_volume_010
else if v_rth_barnum == 11 then v_avg_volume_011
else if v_rth_barnum == 12 then v_avg_volume_012
else if v_rth_barnum == 13 then v_avg_volume_013
else if v_rth_barnum == 14 then v_avg_volume_014
else if v_rth_barnum == 15 then v_avg_volume_015
else if v_rth_barnum == 16 then v_avg_volume_016
else if v_rth_barnum == 17 then v_avg_volume_017
else if v_rth_barnum == 18 then v_avg_volume_018
else if v_rth_barnum == 19 then v_avg_volume_019
else if v_rth_barnum == 20 then v_avg_volume_020
else if v_rth_barnum == 21 then v_avg_volume_021
else if v_rth_barnum == 22 then v_avg_volume_022
else if v_rth_barnum == 23 then v_avg_volume_023
else if v_rth_barnum == 24 then v_avg_volume_024
else if v_rth_barnum == 25 then v_avg_volume_025
else if v_rth_barnum == 26 then v_avg_volume_026
else if v_rth_barnum == 27 then v_avg_volume_027
else if v_rth_barnum == 28 then v_avg_volume_028
else if v_rth_barnum == 29 then v_avg_volume_029
else if v_rth_barnum == 30 then v_avg_volume_030
else if v_rth_barnum == 31 then v_avg_volume_031
else if v_rth_barnum == 32 then v_avg_volume_032
else if v_rth_barnum == 33 then v_avg_volume_033
else if v_rth_barnum == 34 then v_avg_volume_034
else if v_rth_barnum == 35 then v_avg_volume_035
else if v_rth_barnum == 36 then v_avg_volume_036
else if v_rth_barnum == 37 then v_avg_volume_037
else if v_rth_barnum == 38 then v_avg_volume_038
else if v_rth_barnum == 39 then v_avg_volume_039
else if v_rth_barnum == 40 then v_avg_volume_040
else if v_rth_barnum == 41 then v_avg_volume_041
else if v_rth_barnum == 42 then v_avg_volume_042
else if v_rth_barnum == 43 then v_avg_volume_043
else if v_rth_barnum == 44 then v_avg_volume_044
else if v_rth_barnum == 45 then v_avg_volume_045
else if v_rth_barnum == 46 then v_avg_volume_046
else if v_rth_barnum == 47 then v_avg_volume_047
else if v_rth_barnum == 48 then v_avg_volume_048
else if v_rth_barnum == 49 then v_avg_volume_049
else if v_rth_barnum == 50 then v_avg_volume_050
else if v_rth_barnum == 51 then v_avg_volume_051
else if v_rth_barnum == 52 then v_avg_volume_052
else if v_rth_barnum == 53 then v_avg_volume_053
else if v_rth_barnum == 54 then v_avg_volume_054
else if v_rth_barnum == 55 then v_avg_volume_055
else if v_rth_barnum == 56 then v_avg_volume_056
else if v_rth_barnum == 57 then v_avg_volume_057
else if v_rth_barnum == 58 then v_avg_volume_058
else if v_rth_barnum == 59 then v_avg_volume_059
else if v_rth_barnum == 60 then v_avg_volume_060
else if v_rth_barnum == 61 then v_avg_volume_061
else if v_rth_barnum == 62 then v_avg_volume_062
else if v_rth_barnum == 63 then v_avg_volume_063
else if v_rth_barnum == 64 then v_avg_volume_064
else if v_rth_barnum == 65 then v_avg_volume_065
else if v_rth_barnum == 66 then v_avg_volume_066
else if v_rth_barnum == 67 then v_avg_volume_067
else if v_rth_barnum == 68 then v_avg_volume_068
else if v_rth_barnum == 69 then v_avg_volume_069
else if v_rth_barnum == 70 then v_avg_volume_070
else if v_rth_barnum == 71 then v_avg_volume_071
else if v_rth_barnum == 72 then v_avg_volume_072
else if v_rth_barnum == 73 then v_avg_volume_073
else if v_rth_barnum == 74 then v_avg_volume_074
else if v_rth_barnum == 75 then v_avg_volume_075
else if v_rth_barnum == 76 then v_avg_volume_076
else if v_rth_barnum == 77 then v_avg_volume_077
else if v_rth_barnum == 78 then v_avg_volume_078
else if v_rth_barnum == 79 then v_avg_volume_079
else if v_rth_barnum == 80 then v_avg_volume_080
else if v_rth_barnum == 81 then v_avg_volume_081
else if v_rth_barnum == 82 then v_avg_volume_082
else if v_rth_barnum == 83 then v_avg_volume_083
else if v_rth_barnum == 84 then v_avg_volume_084
else if v_rth_barnum == 85 then v_avg_volume_085
else if v_rth_barnum == 86 then v_avg_volume_086
else if v_rth_barnum == 87 then v_avg_volume_087
else if v_rth_barnum == 88 then v_avg_volume_088
else if v_rth_barnum == 89 then v_avg_volume_089
else if v_rth_barnum == 90 then v_avg_volume_090
else if v_rth_barnum == 91 then v_avg_volume_091
else if v_rth_barnum == 92 then v_avg_volume_092
else if v_rth_barnum == 93 then v_avg_volume_093
else if v_rth_barnum == 94 then v_avg_volume_094
else if v_rth_barnum == 95 then v_avg_volume_095
else if v_rth_barnum == 96 then v_avg_volume_096
else if v_rth_barnum == 97 then v_avg_volume_097
else if v_rth_barnum == 98 then v_avg_volume_098
else if v_rth_barnum == 99 then v_avg_volume_099
else if v_rth_barnum == 100 then v_avg_volume_100
else if v_rth_barnum == 101 then v_avg_volume_101
else if v_rth_barnum == 102 then v_avg_volume_102
else if v_rth_barnum == 103 then v_avg_volume_103
else if v_rth_barnum == 104 then v_avg_volume_104
else if v_rth_barnum == 105 then v_avg_volume_105
else if v_rth_barnum == 106 then v_avg_volume_106
else if v_rth_barnum == 107 then v_avg_volume_107
else if v_rth_barnum == 108 then v_avg_volume_108
else if v_rth_barnum == 109 then v_avg_volume_109
else if v_rth_barnum == 110 then v_avg_volume_110
else if v_rth_barnum == 111 then v_avg_volume_111
else if v_rth_barnum == 112 then v_avg_volume_112
else if v_rth_barnum == 113 then v_avg_volume_113
else if v_rth_barnum == 114 then v_avg_volume_114
else if v_rth_barnum == 115 then v_avg_volume_115
else if v_rth_barnum == 116 then v_avg_volume_116
else if v_rth_barnum == 117 then v_avg_volume_117
else if v_rth_barnum == 118 then v_avg_volume_118
else if v_rth_barnum == 119 then v_avg_volume_119
else if v_rth_barnum == 120 then v_avg_volume_120
else if v_rth_barnum == 121 then v_avg_volume_121
else if v_rth_barnum == 122 then v_avg_volume_122
else if v_rth_barnum == 123 then v_avg_volume_123
else if v_rth_barnum == 124 then v_avg_volume_124
else if v_rth_barnum == 125 then v_avg_volume_125
else if v_rth_barnum == 126 then v_avg_volume_126
else if v_rth_barnum == 127 then v_avg_volume_127
else if v_rth_barnum == 128 then v_avg_volume_128
else if v_rth_barnum == 129 then v_avg_volume_129
else if v_rth_barnum == 130 then v_avg_volume_130
else if v_rth_barnum == 131 then v_avg_volume_131
else if v_rth_barnum == 132 then v_avg_volume_132
else if v_rth_barnum == 133 then v_avg_volume_133
else if v_rth_barnum == 134 then v_avg_volume_134
else if v_rth_barnum == 135 then v_avg_volume_135
else if v_rth_barnum == 136 then v_avg_volume_136
else if v_rth_barnum == 137 then v_avg_volume_137
else if v_rth_barnum == 138 then v_avg_volume_138
else if v_rth_barnum == 139 then v_avg_volume_139
else if v_rth_barnum == 140 then v_avg_volume_140
else if v_rth_barnum == 141 then v_avg_volume_141
else if v_rth_barnum == 142 then v_avg_volume_142
else if v_rth_barnum == 143 then v_avg_volume_143
else if v_rth_barnum == 144 then v_avg_volume_144
else if v_rth_barnum == 145 then v_avg_volume_145
else if v_rth_barnum == 146 then v_avg_volume_146
else if v_rth_barnum == 147 then v_avg_volume_147
else if v_rth_barnum == 148 then v_avg_volume_148
else if v_rth_barnum == 149 then v_avg_volume_149
else if v_rth_barnum == 150 then v_avg_volume_150
else if v_rth_barnum == 151 then v_avg_volume_151
else if v_rth_barnum == 152 then v_avg_volume_152
else if v_rth_barnum == 153 then v_avg_volume_153
else if v_rth_barnum == 154 then v_avg_volume_154
else if v_rth_barnum == 155 then v_avg_volume_155
else if v_rth_barnum == 156 then v_avg_volume_156
else if v_rth_barnum == 157 then v_avg_volume_157
else if v_rth_barnum == 158 then v_avg_volume_158
else if v_rth_barnum == 159 then v_avg_volume_159
else if v_rth_barnum == 160 then v_avg_volume_160
else if v_rth_barnum == 161 then v_avg_volume_161
else if v_rth_barnum == 162 then v_avg_volume_162
else if v_rth_barnum == 163 then v_avg_volume_163
else if v_rth_barnum == 164 then v_avg_volume_164
else if v_rth_barnum == 165 then v_avg_volume_165
else if v_rth_barnum == 166 then v_avg_volume_166
else if v_rth_barnum == 167 then v_avg_volume_167
else if v_rth_barnum == 168 then v_avg_volume_168
else if v_rth_barnum == 169 then v_avg_volume_169
else if v_rth_barnum == 170 then v_avg_volume_170
else if v_rth_barnum == 171 then v_avg_volume_171
else if v_rth_barnum == 172 then v_avg_volume_172
else if v_rth_barnum == 173 then v_avg_volume_173
else if v_rth_barnum == 174 then v_avg_volume_174
else if v_rth_barnum == 175 then v_avg_volume_175
else if v_rth_barnum == 176 then v_avg_volume_176
else if v_rth_barnum == 177 then v_avg_volume_177
else if v_rth_barnum == 178 then v_avg_volume_178
else if v_rth_barnum == 179 then v_avg_volume_179
else if v_rth_barnum == 180 then v_avg_volume_180
else if v_rth_barnum == 181 then v_avg_volume_181
else if v_rth_barnum == 182 then v_avg_volume_182
else if v_rth_barnum == 183 then v_avg_volume_183
else if v_rth_barnum == 184 then v_avg_volume_184
else if v_rth_barnum == 185 then v_avg_volume_185
else if v_rth_barnum == 186 then v_avg_volume_186
else if v_rth_barnum == 187 then v_avg_volume_187
else if v_rth_barnum == 188 then v_avg_volume_188
else if v_rth_barnum == 189 then v_avg_volume_189
else if v_rth_barnum == 190 then v_avg_volume_190
else if v_rth_barnum == 191 then v_avg_volume_191
else if v_rth_barnum == 192 then v_avg_volume_192
else if v_rth_barnum == 193 then v_avg_volume_193
else if v_rth_barnum == 194 then v_avg_volume_194
else if v_rth_barnum == 195 then v_avg_volume_195
else if v_rth_barnum == 196 then v_avg_volume_196
else if v_rth_barnum == 197 then v_avg_volume_197
else if v_rth_barnum == 198 then v_avg_volume_198
else if v_rth_barnum == 199 then v_avg_volume_199
else if v_rth_barnum == 200 then v_avg_volume_200
else if v_rth_barnum == 201 then v_avg_volume_201
else if v_rth_barnum == 202 then v_avg_volume_202
else if v_rth_barnum == 203 then v_avg_volume_203
else Double.Nan;

def v_accumulated_volume = if v_rth then volume + v_accumulated_volume[1] else 0;
def v_avg_accumulated_volume = if v_rth then v_avg_bar_volume + v_avg_accumulated_volume[1] else 0;
def v_avg_daily_volume = volume(period = AggregationPeriod.DAY)[i_days_length];
def v_pct_to_avg = (v_accumulated_volume/v_avg_accumulated_volume - 1)*100;
def v_pct_to_avg_pos = if v_pct_to_avg > 0 then v_pct_to_avg else Double.NaN;
def v_pct_to_avg_neg = if v_pct_to_avg < 0 then v_pct_to_avg else Double.NaN;

#PLOTS
plot p_0 = 0;
plot p_avg_daily_volume = v_avg_daily_volume;
plot p_avg_accumulated_volume = v_avg_accumulated_volume;
plot p_accumulated_volume = v_accumulated_volume;
plot p_pct_to_avg_pos = v_pct_to_avg_pos;
plot p_pct_to_avg_neg = v_pct_to_avg_neg;

#PLOT STYLES & SETTINGS
p_0.AssignValueColor(Color.WHITE);
p_avg_daily_volume.SetPaintingStrategy(PaintingStrategy.DASHES);
p_avg_daily_volume.SetDefaultColor(Color.WHITE);
p_avg_accumulated_volume.SetPaintingStrategy(PaintingStrategy.LINE);
p_avg_accumulated_volume.SetDefaultColor(Color.WHITE);
p_avg_accumulated_volume.SetLineWeight(1);
p_accumulated_volume.SetPaintingStrategy(PaintingStrategy.SQUARED_HISTOGRAM);
p_accumulated_volume.AssignValueColor(if v_accumulated_volume > v_avg_accumulated_volume then Color.GREEN else Color.RED);
p_pct_to_avg_pos.SetPaintingStrategy(PaintingStrategy.SQUARED_HISTOGRAM);
p_pct_to_avg_pos.AssignNormGradientColor(v_rth_barnum + 1, Color.WHITE, Color.GREEN);
p_pct_to_avg_neg.SetPaintingStrategy(PaintingStrategy.SQUARED_HISTOGRAM);
p_pct_to_avg_neg.AssignNormGradientColor(v_rth_barnum + 1, Color.RED, Color.WHITE);

#LABELS
AddLabel(i_print_label_accumulation, "ACCUMULATED VOLUME: " + v_accumulated_volume, if v_accumulated_volume > v_avg_accumulated_volume then Color.LIGHT_GREEN else if v_accumulated_volume < v_avg_accumulated_volume then Color.PINK else Color.WHITE);
AddLabel(i_print_label_pct, "PERCENTAGE +/- FROM AVG ACCUMULATION: " + v_pct_to_avg, if v_accumulated_volume > v_avg_accumulated_volume then Color.LIGHT_GREEN else if v_accumulated_volume < v_avg_accumulated_volume then Color.PINK else Color.White);

https://tos.mx/Gp3r14W
 
This is the built in code of TOS for RelativeVolumeStDev

i however when its charted on a chart i just want to hide (not show) the bars that are under 2.0 times the relative volume.
example pic of what im trying to hide attached

Code:
#
# TD Ameritrade IP Company, Inc. (c) 2014-2019
#

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

nnwid8K.png
 

Attachments

  • nnwid8K.png
    nnwid8K.png
    109 KB · Views: 561
@XeoNoX Per your request I have modified your study so that it only displays bars ABOVE the dotted line.
Here is the code, I tested against your 1 min chart of AMD

Code:
declare lower;
declare zerobase;

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

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

plot StDevLevel = numDev;
plot RV = if RelVol > numDev then RelVol else Double.NaN;

RV.SetPaintingStrategy(PaintingStrategy.HISTOGRAM);
RV.SetLineWeight(3);
RV.DefineColor("Above", GetColor(0));
RV.DefineColor("Below", GetColor(2));
RV.AssignValueColor(if RelVol >= numDev then RV.Color("Above") else RV.Color("Below"));
StDevLevel.SetDefaultColor(GetColor(7));
StDevLevel.SetStyle(Curve.SHORT_DASH);
# End Code
 
Last edited:
Wow. Thank you @horserider! I haven't spent a great deal of time with the indicator yet but there are a couple of uses that I am eager to try in the future.

An example I see from today is AMD using a 3 min chart. AMD started at 0930 with a +22% above accumulation but slowly was losing that % until 1124 when it was at +2.4%. The percentage increased to +5% on the next candle with the price breaking the high of day at the same time. The accumulation continued to grow throughout the day to +28%. The normal volume bars definitely show the increase on the breakout but I feel like this indicator paints a clearer picture of the increased volume throughout the day. In this case you could just use it as confirmation to stay in the trade as the price and relative volume continued to ascend together.

Another idea for this indicator is an alert for a rapid increase in the accumulation percentage. Something like a 10% change since the last candlestick to trigger the alert. An example of this would be BA last week with news on 11/14. The AP went from -9.4% to +5.7% in 3mins. It would be hard to catch the initial move up but you could still have entered for a few dollar gain.
 
@toncuz If the script does not show up most likely no one has done it and likely no one has an interest in your first hour comparisons. Maybe just do a 20 period chart and compare first hour volumes visually. Is there some logic why first hour volume across different days will provide a trading advantage?
 
Relative volume is one of the most important metrics to get an edge. Why on earth would anyone compare volume at 2pm with volume at 10pm...which is always triple average volume simply because it's the opening hour??? You have to compare apples to apples. How can anyone put on a morning day trade without knowing the relative volume of the first hour compared to average volume of the last 20 first hours? This is something Finviz always had. Yet, TOS is still getting out of bed.

How can anyone put on a 1pm day trade without knowing average volume of the last 20 1pm volumes??
 
You could try to build what you are looking for using this as a template: https://usethinkscript.com/threads/unusual-volume-scanner-for-thinkorswim.247/#post-1477

Please let me know here how it worked out for you. I also pulled these studies out of the One Note: https://tos.mx/ozZx1u – alert Relative Vol Std Dev This one may be customizable: watchlist column StockSizzle (unusual underlying volume): https://tos.mx/43abXO  These are old, hopefully they still work.

Code:
#Give this a try: You can set the volume percent and the average days to use.

#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
 
@toncuz Try this snippet for your scan. You will have to adjust the plot statement, it is just an example.

Code:
# Mobius_TimeBracketConditions-scan
# Time Bracket condition

input Begin  = 0930;
input End    = 1030;

   def Active = if SecondsFromTime(Begin) > 0 and
                   SecondsTillTime(End) >= 0 
                then 1 
                else 0;
   def VA20 =    Volume(Average, 20) #Example
  
Plot = VA20 #Example
 
I want to be able to see volume for different timeframes/lookback periods on my watchlist (i.e. a column for daily volume looking back 20 periods and another for 15 minute volume looking back 15 periods). Would also like to have it color coded so above X percentage would show as a different color for easy identification. Anyone seen anything close to this?

Thanks!
 

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