Zanger Volume Ratio Indicator for ThinkorSwim

I am trying to make Zanger Volume Ratio work in TOS. This script was made by @horserider. I am modifying it to match Dan Zanger's settings.
One thing I noticed is that I get different values if I use RTH data. When I include pre and post-market data, it works. I would like to change the settings so that it works for RTH data only.

Grid with pre and post-market data: https://tos.mx/49nT0sO
Grid with RTH data: https://tos.mx/QZQ6UkL

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 = 20;

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

plot RVOL = v_accumulated_volume / v_avg_accumulated_volume  * 100;
RVOL.SetPaintingStrategy(PaintingStrategy.HISTOGRAM);

#v_pct_to_avg.AssignNormGradientColor(20, Color.LIGHT_RED, Color.Green);
RVOL.assignValueColor(if RVOL > 161.8 then Color.green
else if 127 < RVOL and  RVOL < 161.8 then Color.light_green
else if 78.6 < RVOL and  RVOL < 127 then Color.gray
else if 61.8 < RVOL and  RVOL < 78.6 then Color.yellow
else if 38.2 < RVOL and  RVOL < 61.8 then Color.pink
else Color.red);

Thanks in advance.

Regards,
Alok
 
Reviving an old thread here. Does anyone know how to make this display data all the way through the close of regular trading hours? This script seems to stop displaying data one hour before the close (12pm PST). See screen shot below. I looked at the script and thought it may have something to do with how many bars it is calculating data for (stops at 203) so I tried to add a few more lines to calculate more bars but that did not help. I've tried this with both RTH and after hours data displayed and get the same result. Any thoughts? Thanks!

19OW6f4.jpg
 
Reviving an old thread here. Does anyone know how to make this display data all the way through the close of regular trading hours? This script seems to stop displaying data one hour before the close (12pm PST). See screen shot below. I looked at the script and thought it may have something to do with how many bars it is calculating data for (stops at 203) so I tried to add a few more lines to calculate more bars but that did not help. I've tried this with both RTH and after hours data displayed and get the same result. Any thoughts? Thanks!
Was just looking at this and had the same question. If somebody can get this figured out i can program the rest of it to match zangers (or pretty close to it) I'm just not really familiar with intraday "minutes/seconds till" programming.

Also just as an fyi, the default amount of days the volume is compared against is 20 and the aggregation period used for calculation is 5 minute chunks, not 1.
 
Last edited:
Was just looking at this and had the same question. If somebody can get this figured out i can program the rest of it to match zangers (or pretty close to it) I'm just not really familiar with intraday "minutes/seconds till" programming.

Also just as an fyi, the default amount of days the volume is compared against is 20 and the aggregation period used for calculation is 5 minute chunks, not 1.
Does this help?


Code:
declare upper;;
def na = Double.NaN;

def AP = getAggregationPeriod();
rec barcounter = if GetDay() != GetDay()[1] then 1 else barcounter[1] + 1;

rec daycount = if barNumber() == 1 then 0 else if GetDay() > GetDay()[1] then 1 else 0;

def istoday = if GetLastDay() == GetDay() then 1 else 0;

def bar1volume = if istoday then 0 else if barcounter == 1 then volume(period = AggregationPeriod.hour) else 0;
def bar2volume = if istoday then 0 else if barcounter == 2 then volume(period = AggregationPeriod.hour) else 0;
def bar3volume = if istoday then 0 else if barcounter == 3 then volume(period = AggregationPeriod.hour) else 0;
def bar4volume = if istoday then 0 else if barcounter == 4 then volume(period = AggregationPeriod.hour) else 0;
def bar5volume = if istoday then 0 else if barcounter == 5 then volume(period = AggregationPeriod.hour) else 0;
def bar6volume = if istoday then 0 else if barcounter == 6 then volume(period = AggregationPeriod.hour) else 0;
def bar7volume = if istoday then 0 else if barcounter == 7 then volume(period = AggregationPeriod.hour) else 0;
def bar8volume = if istoday then 0 else if barcounter == 8 then volume(period = AggregationPeriod.hour) else 0;
def bar9volume = if istoday then 0 else if barcounter == 9 then volume(period = AggregationPeriod.hour) else 0;
def bar10volume = if istoday then 0 else if barcounter == 10 then volume(period = AggregationPeriod.hour) else 0;
def bar11volume = if istoday then 0 else if barcounter == 11 then volume(period = AggregationPeriod.hour) else 0;
def bar12volume = if istoday then 0 else if barcounter == 12 then volume(period = AggregationPeriod.hour) else 0;
def bar13volume = if istoday then 0 else if barcounter == 13 then volume(period = AggregationPeriod.hour) else 0;
def bar14volume = if istoday then 0 else if barcounter == 14 then volume(period = AggregationPeriod.hour) else 0;
def bar15volume = if istoday then 0 else if barcounter == 15 then volume(period = AggregationPeriod.hour) else 0;
def bar16volume = if istoday then 0 else if barcounter == 16 then volume(period = AggregationPeriod.hour) else 0;
def bar17volume = if istoday then 0 else if barcounter == 17 then volume(period = AggregationPeriod.hour) else 0;
def bar18volume = if istoday then 0 else if barcounter == 18 then volume(period = AggregationPeriod.hour) else 0;
def bar19volume = if istoday then 0 else if barcounter == 19 then volume(period = AggregationPeriod.hour) else 0;
def bar20volume = if istoday then 0 else if barcounter == 20 then volume(period = AggregationPeriod.hour) else 0;
def bar21volume = if istoday then 0 else if barcounter == 21 then volume(period = AggregationPeriod.hour) else 0;
def bar22volume = if istoday then 0 else if barcounter == 22 then volume(period = AggregationPeriod.hour) else 0;
def bar23volume = if istoday then 0 else if barcounter == 23 then volume(period = AggregationPeriod.hour) else 0;
def bar24volume = if istoday then 0 else if barcounter == 24 then volume(period = AggregationPeriod.hour) else 0;
def bar25volume = if istoday then 0 else if barcounter == 25 then volume(period = AggregationPeriod.hour) else 0;
def bar26volume = if istoday then 0 else if barcounter == 26 then volume(period = AggregationPeriod.hour) else 0;
def bar27volume = if istoday then 0 else if barcounter == 27 then volume(period = AggregationPeriod.hour) else 0;
def bar28volume = if istoday then 0 else if barcounter == 28 then volume(period = AggregationPeriod.hour) else 0;
def bar29volume = if istoday then 0 else if barcounter == 29 then volume(period = AggregationPeriod.hour) else 0;
def bar30volume = if istoday then 0 else if barcounter == 30 then volume(period = AggregationPeriod.hour) else 0;
def bar31volume = if istoday then 0 else if barcounter == 31 then volume(period = AggregationPeriod.hour) else 0;
def bar32volume = if istoday then 0 else if barcounter == 32 then volume(period = AggregationPeriod.hour) else 0;
def bar33volume = if istoday then 0 else if barcounter == 33 then volume(period = AggregationPeriod.hour) else 0;
def bar34volume = if istoday then 0 else if barcounter == 34 then volume(period = AggregationPeriod.hour) else 0;
def bar35volume = if istoday then 0 else if barcounter == 35 then volume(period = AggregationPeriod.hour) else 0;
def bar36volume = if istoday then 0 else if barcounter == 36 then volume(period = AggregationPeriod.hour) else 0;
def bar37volume = if istoday then 0 else if barcounter == 37 then volume(period = AggregationPeriod.hour) else 0;
def bar38volume = if istoday then 0 else if barcounter == 38 then volume(period = AggregationPeriod.hour) else 0;
def bar39volume = if istoday then 0 else if barcounter == 39 then volume(period = AggregationPeriod.hour) else 0;
def bar40volume = if istoday then 0 else if barcounter == 40 then volume(period = AggregationPeriod.hour) else 0;
def bar41volume = if istoday then 0 else if barcounter == 41 then volume(period = AggregationPeriod.hour) else 0;
def bar42volume = if istoday then 0 else if barcounter == 42 then volume(period = AggregationPeriod.hour) else 0;
def bar43volume = if istoday then 0 else if barcounter == 43 then volume(period = AggregationPeriod.hour) else 0;
def bar44volume = if istoday then 0 else if barcounter == 44 then volume(period = AggregationPeriod.hour) else 0;
def bar45volume = if istoday then 0 else if barcounter == 45 then volume(period = AggregationPeriod.hour) else 0;
def bar46volume = if istoday then 0 else if barcounter == 46 then volume(period = AggregationPeriod.hour) else 0;
def bar47volume = if istoday then 0 else if barcounter == 47 then volume(period = AggregationPeriod.hour) else 0;
def bar48volume = if istoday then 0 else if barcounter == 48 then volume(period = AggregationPeriod.hour) else 0;
def bar49volume = if istoday then 0 else if barcounter == 49 then volume(period = AggregationPeriod.hour) else 0;
def bar50volume = if istoday then 0 else if barcounter == 50 then volume(period = AggregationPeriod.hour) else 0;
def bar51volume = if istoday then 0 else if barcounter == 51 then volume(period = AggregationPeriod.hour) else 0;
def bar52volume = if istoday then 0 else if barcounter == 52 then volume(period = AggregationPeriod.hour) else 0;
def bar53volume = if istoday then 0 else if barcounter == 53 then volume(period = AggregationPeriod.hour) else 0;
def bar54volume = if istoday then 0 else if barcounter == 54 then volume(period = AggregationPeriod.hour) else 0;
def bar55volume = if istoday then 0 else if barcounter == 55 then volume(period = AggregationPeriod.hour) else 0;
def bar56volume = if istoday then 0 else if barcounter == 56 then volume(period = AggregationPeriod.hour) else 0;
def bar57volume = if istoday then 0 else if barcounter == 57 then volume(period = AggregationPeriod.hour) else 0;
def bar58volume = if istoday then 0 else if barcounter == 58 then volume(period = AggregationPeriod.hour) else 0;
def bar59volume = if istoday then 0 else if barcounter == 59 then volume(period = AggregationPeriod.hour) else 0;
def bar60volume = if istoday then 0 else if barcounter == 60 then volume(period = AggregationPeriod.hour) else 0;
def bar61volume = if istoday then 0 else if barcounter == 61 then volume(period = AggregationPeriod.hour) else 0;
def bar62volume = if istoday then 0 else if barcounter == 62 then volume(period = AggregationPeriod.hour) else 0;
def bar63volume = if istoday then 0 else if barcounter == 63 then volume(period = AggregationPeriod.hour) else 0;
def bar64volume = if istoday then 0 else if barcounter == 64 then volume(period = AggregationPeriod.hour) else 0;
def bar65volume = if istoday then 0 else if barcounter == 65 then volume(period = AggregationPeriod.hour) else 0;
def bar66volume = if istoday then 0 else if barcounter == 66 then volume(period = AggregationPeriod.hour) else 0;
def bar67volume = if istoday then 0 else if barcounter == 67 then volume(period = AggregationPeriod.hour) else 0;
def bar68volume = if istoday then 0 else if barcounter == 68 then volume(period = AggregationPeriod.hour) else 0;
def bar69volume = if istoday then 0 else if barcounter == 69 then volume(period = AggregationPeriod.hour) else 0;
def bar70volume = if istoday then 0 else if barcounter == 70 then volume(period = AggregationPeriod.hour) else 0;
def bar71volume = if istoday then 0 else if barcounter == 71 then volume(period = AggregationPeriod.hour) else 0;
def bar72volume = if istoday then 0 else if barcounter == 72 then volume(period = AggregationPeriod.hour) else 0;
def bar73volume = if istoday then 0 else if barcounter == 73 then volume(period = AggregationPeriod.hour) else 0;
def bar74volume = if istoday then 0 else if barcounter == 74 then volume(period = AggregationPeriod.hour) else 0;
def bar75volume = if istoday then 0 else if barcounter == 75 then volume(period = AggregationPeriod.hour) else 0;
def bar76volume = if istoday then 0 else if barcounter == 76 then volume(period = AggregationPeriod.hour) else 0;
def bar77volume = if istoday then 0 else if barcounter == 77 then volume(period = AggregationPeriod.hour) else 0;
def bar78volume = if istoday then 0 else if barcounter == 78 then volume(period = AggregationPeriod.hour) else 0;
def bar79volume = if istoday then 0 else if barcounter == 79 then volume(period = AggregationPeriod.hour) else 0;
def bar80volume = if istoday then 0 else if barcounter == 80 then volume(period = AggregationPeriod.hour) else 0;
def bar81volume = if istoday then 0 else if barcounter == 81 then volume(period = AggregationPeriod.hour) else 0;
def bar82volume = if istoday then 0 else if barcounter == 82 then volume(period = AggregationPeriod.hour) else 0;
def bar83volume = if istoday then 0 else if barcounter == 83 then volume(period = AggregationPeriod.hour) else 0;
def bar84volume = if istoday then 0 else if barcounter == 84 then volume(period = AggregationPeriod.hour) else 0;
def bar85volume = if istoday then 0 else if barcounter == 85 then volume(period = AggregationPeriod.hour) else 0;
def bar86volume = if istoday then 0 else if barcounter == 86 then volume(period = AggregationPeriod.hour) else 0;
def bar87volume = if istoday then 0 else if barcounter == 87 then volume(period = AggregationPeriod.hour) else 0;
def bar88volume = if istoday then 0 else if barcounter == 88 then volume(period = AggregationPeriod.hour) else 0;
def bar89volume = if istoday then 0 else if barcounter == 89 then volume(period = AggregationPeriod.hour) else 0;
def bar90volume = if istoday then 0 else if barcounter == 90 then volume(period = AggregationPeriod.hour) else 0;
def bar91volume = if istoday then 0 else if barcounter == 91 then volume(period = AggregationPeriod.hour) else 0;
def bar92volume = if istoday then 0 else if barcounter == 92 then volume(period = AggregationPeriod.hour) else 0;
def bar93volume = if istoday then 0 else if barcounter == 93 then volume(period = AggregationPeriod.hour) else 0;
def bar94volume = if istoday then 0 else if barcounter == 94 then volume(period = AggregationPeriod.hour) else 0;
def bar95volume = if istoday then 0 else if barcounter == 95 then volume(period = AggregationPeriod.hour) else 0;
def bar96volume = if istoday then 0 else if barcounter == 96 then volume(period = AggregationPeriod.hour) else 0;
def bar97volume = if istoday then 0 else if barcounter == 97 then volume(period = AggregationPeriod.hour) else 0;
def bar98volume = if istoday then 0 else if barcounter == 98 then volume(period = AggregationPeriod.hour) else 0;
def bar99volume = if istoday then 0 else if barcounter == 99 then volume(period = AggregationPeriod.hour) else 0;
def bar100volume = if istoday then 0 else if barcounter == 100 then volume(period = AggregationPeriod.hour) else 0;
def bar101volume = if istoday then 0 else if barcounter == 101 then volume(period = AggregationPeriod.hour) else 0;
def bar102volume = if istoday then 0 else if barcounter == 102 then volume(period = AggregationPeriod.hour) else 0;
def bar103volume = if istoday then 0 else if barcounter == 103 then volume(period = AggregationPeriod.hour) else 0;
def bar104volume = if istoday then 0 else if barcounter == 104 then volume(period = AggregationPeriod.hour) else 0;
def bar105volume = if istoday then 0 else if barcounter == 105 then volume(period = AggregationPeriod.hour) else 0;
def bar106volume = if istoday then 0 else if barcounter == 106 then volume(period = AggregationPeriod.hour) else 0;
def bar107volume = if istoday then 0 else if barcounter == 107 then volume(period = AggregationPeriod.hour) else 0;
def bar108volume = if istoday then 0 else if barcounter == 108 then volume(period = AggregationPeriod.hour) else 0;
def bar109volume = if istoday then 0 else if barcounter == 109 then volume(period = AggregationPeriod.hour) else 0;
def bar110volume = if istoday then 0 else if barcounter == 110 then volume(period = AggregationPeriod.hour) else 0;
def bar111volume = if istoday then 0 else if barcounter == 111 then volume(period = AggregationPeriod.hour) else 0;
def bar112volume = if istoday then 0 else if barcounter == 112 then volume(period = AggregationPeriod.hour) else 0;
def bar113volume = if istoday then 0 else if barcounter == 113 then volume(period = AggregationPeriod.hour) else 0;
def bar114volume = if istoday then 0 else if barcounter == 114 then volume(period = AggregationPeriod.hour) else 0;
def bar115volume = if istoday then 0 else if barcounter == 115 then volume(period = AggregationPeriod.hour) else 0;
def bar116volume = if istoday then 0 else if barcounter == 116 then volume(period = AggregationPeriod.hour) else 0;
def bar117volume = if istoday then 0 else if barcounter == 117 then volume(period = AggregationPeriod.hour) else 0;
def bar118volume = if istoday then 0 else if barcounter == 118 then volume(period = AggregationPeriod.hour) else 0;
def bar119volume = if istoday then 0 else if barcounter == 119 then volume(period = AggregationPeriod.hour) else 0;
def bar120volume = if istoday then 0 else if barcounter == 120 then volume(period = AggregationPeriod.hour) else 0;
def bar121volume = if istoday then 0 else if barcounter == 121 then volume(period = AggregationPeriod.hour) else 0;
def bar122volume = if istoday then 0 else if barcounter == 122 then volume(period = AggregationPeriod.hour) else 0;
def bar123volume = if istoday then 0 else if barcounter == 123 then volume(period = AggregationPeriod.hour) else 0;
def bar124volume = if istoday then 0 else if barcounter == 124 then volume(period = AggregationPeriod.hour) else 0;
def bar125volume = if istoday then 0 else if barcounter == 125 then volume(period = AggregationPeriod.hour) else 0;
def bar126volume = if istoday then 0 else if barcounter == 126 then volume(period = AggregationPeriod.hour) else 0;
def bar127volume = if istoday then 0 else if barcounter == 127 then volume(period = AggregationPeriod.hour) else 0;
def bar128volume = if istoday then 0 else if barcounter == 128 then volume(period = AggregationPeriod.hour)
 else 0;
def bar129volume = if istoday then 0 else if barcounter == 129 then volume(period = AggregationPeriod.hour) else 0;
def bar130volume = if istoday then 0 else if barcounter == 130 then volume(period = AggregationPeriod.hour) else 0;

def avgbar1 = TotalSum(bar1volume) / TotalSum(daycount);
def avgbar2 = TotalSum(bar2volume) / TotalSum(daycount);
def avgbar3 = TotalSum(bar3volume) / TotalSum(daycount);
def avgbar4 = TotalSum(bar4volume) / TotalSum(daycount);
def avgbar5 = TotalSum(bar5volume) / TotalSum(daycount);
def avgbar6 = TotalSum(bar6volume) / TotalSum(daycount);
def avgbar7 = TotalSum(bar7volume) / TotalSum(daycount);
def avgbar8 = TotalSum(bar8volume) / TotalSum(daycount);
def avgbar9 = TotalSum(bar9volume) / TotalSum(daycount);
def avgbar10 = TotalSum(bar10volume) / TotalSum(daycount);
def avgbar11 = TotalSum(bar11volume) / TotalSum(daycount);
def avgbar12 = TotalSum(bar12volume) / TotalSum(daycount);
def avgbar13 = TotalSum(bar13volume) / TotalSum(daycount);
def avgbar14 = TotalSum(bar14volume) / TotalSum(daycount);
def avgbar15 = TotalSum(bar15volume) / TotalSum(daycount);
def avgbar16 = TotalSum(bar16volume) / TotalSum(daycount);
def avgbar17 = TotalSum(bar17volume) / TotalSum(daycount);
def avgbar18 = TotalSum(bar18volume) / TotalSum(daycount);
def avgbar19 = TotalSum(bar19volume) / TotalSum(daycount);
def avgbar20 = TotalSum(bar20volume) / TotalSum(daycount);
def avgbar21 = TotalSum(bar21volume) / TotalSum(daycount);
def avgbar22 = TotalSum(bar22volume) / TotalSum(daycount);
def avgbar23 = TotalSum(bar23volume) / TotalSum(daycount);
def avgbar24 = TotalSum(bar24volume) / TotalSum(daycount);
def avgbar25 = TotalSum(bar25volume) / TotalSum(daycount);
def avgbar26 = TotalSum(bar26volume) / TotalSum(daycount);
def avgbar27 = TotalSum(bar27volume) / TotalSum(daycount);
def avgbar28 = TotalSum(bar28volume) / TotalSum(daycount);
def avgbar29 = TotalSum(bar29volume) / TotalSum(daycount);
def avgbar30 = TotalSum(bar30volume) / TotalSum(daycount);
def avgbar31 = TotalSum(bar31volume) / TotalSum(daycount);
def avgbar32 = TotalSum(bar32volume) / TotalSum(daycount);
def avgbar33 = TotalSum(bar33volume) / TotalSum(daycount);
def avgbar34 = TotalSum(bar34volume) / TotalSum(daycount);
def avgbar35 = TotalSum(bar35volume) / TotalSum(daycount);
def avgbar36 = TotalSum(bar36volume) / TotalSum(daycount);
def avgbar37 = TotalSum(bar37volume) / TotalSum(daycount);
def avgbar38 = TotalSum(bar38volume) / TotalSum(daycount);
def avgbar39 = TotalSum(bar39volume) / TotalSum(daycount);
def avgbar40 = TotalSum(bar40volume) / TotalSum(daycount);
def avgbar41 = TotalSum(bar41volume) / TotalSum(daycount);
def avgbar42 = TotalSum(bar42volume) / TotalSum(daycount);
def avgbar43 = TotalSum(bar43volume) / TotalSum(daycount);
def avgbar44 = TotalSum(bar44volume) / TotalSum(daycount);
def avgbar45 = TotalSum(bar45volume) / TotalSum(daycount);
def avgbar46 = TotalSum(bar46volume) / TotalSum(daycount);
def avgbar47 = TotalSum(bar47volume) / TotalSum(daycount);
def avgbar48 = TotalSum(bar48volume) / TotalSum(daycount);
def avgbar49 = TotalSum(bar49volume) / TotalSum(daycount);
def avgbar50 = TotalSum(bar50volume) / TotalSum(daycount);
def avgbar51 = TotalSum(bar51volume) / TotalSum(daycount);
def avgbar52 = TotalSum(bar52volume) / TotalSum(daycount);
def avgbar53 = TotalSum(bar53volume) / TotalSum(daycount);
def avgbar54 = TotalSum(bar54volume) / TotalSum(daycount);
def avgbar55 = TotalSum(bar55volume) / TotalSum(daycount);
def avgbar56 = TotalSum(bar56volume) / TotalSum(daycount);
def avgbar57 = TotalSum(bar57volume) / TotalSum(daycount);
def avgbar58 = TotalSum(bar58volume) / TotalSum(daycount);
def avgbar59 = TotalSum(bar59volume) / TotalSum(daycount);
def avgbar60 = TotalSum(bar60volume) / TotalSum(daycount);
def avgbar61 = TotalSum(bar61volume) / TotalSum(daycount);
def avgbar62 = TotalSum(bar62volume) / TotalSum(daycount);
def avgbar63 = TotalSum(bar63volume) / TotalSum(daycount);
def avgbar64 = TotalSum(bar64volume) / TotalSum(daycount);
def avgbar65 = TotalSum(bar65volume) / TotalSum(daycount);
def avgbar66 = TotalSum(bar66volume) / TotalSum(daycount);
def avgbar67 = TotalSum(bar67volume) / TotalSum(daycount);
def avgbar68 = TotalSum(bar68volume) / TotalSum(daycount);
def avgbar69 = TotalSum(bar69volume) / TotalSum(daycount);
def avgbar70 = TotalSum(bar70volume) / TotalSum(daycount);
def avgbar71 = TotalSum(bar71volume) / TotalSum(daycount);
def avgbar72 = TotalSum(bar72volume) / TotalSum(daycount);
def avgbar73 = TotalSum(bar73volume) / TotalSum(daycount);
def avgbar74 = TotalSum(bar74volume) / TotalSum(daycount);
def avgbar75 = TotalSum(bar75volume) / TotalSum(daycount);
def avgbar76 = TotalSum(bar76volume) / TotalSum(daycount);
def avgbar77 = TotalSum(bar77volume) / TotalSum(daycount);
def avgbar78 = TotalSum(bar78volume) / TotalSum(daycount);
def avgbar79 = TotalSum(bar79volume) / TotalSum(daycount);
def avgbar80 = TotalSum(bar80volume) / TotalSum(daycount);
def avgbar81 = TotalSum(bar81volume) / TotalSum(daycount);
def avgbar82 = TotalSum(bar82volume) / TotalSum(daycount);
def avgbar83 = TotalSum(bar83volume) / TotalSum(daycount);
def avgbar84 = TotalSum(bar84volume) / TotalSum(daycount);
def avgbar85 = TotalSum(bar85volume) / TotalSum(daycount);
def avgbar86 = TotalSum(bar86volume) / TotalSum(daycount);
def avgbar87 = TotalSum(bar87volume) / TotalSum(daycount);
def avgbar88 = TotalSum(bar88volume) / TotalSum(daycount);
def avgbar89 = TotalSum(bar89volume) / TotalSum(daycount);
def avgbar90 = TotalSum(bar90volume) / TotalSum(daycount);
def avgbar91 = TotalSum(bar91volume) / TotalSum(daycount);
def avgbar92 = TotalSum(bar92volume) / TotalSum(daycount);
def avgbar93 = TotalSum(bar93volume) / TotalSum(daycount);
def avgbar94 = TotalSum(bar94volume) / TotalSum(daycount);
def avgbar95 = TotalSum(bar95volume) / TotalSum(daycount);
def avgbar96 = TotalSum(bar96volume) / TotalSum(daycount);
def avgbar97 = TotalSum(bar97volume) / TotalSum(daycount);
def avgbar98 = TotalSum(bar98volume) / TotalSum(daycount);
def avgbar99 = TotalSum(bar99volume) / TotalSum(daycount);
def avgbar100 = TotalSum(bar100volume) / TotalSum(daycount);
def avgbar101 = TotalSum(bar101volume) / TotalSum(daycount);
def avgbar102 = TotalSum(bar102volume) / TotalSum(daycount);
def avgbar103 = TotalSum(bar103volume) / TotalSum(daycount);
def avgbar104 = TotalSum(bar104volume) / TotalSum(daycount);
def avgbar105 = TotalSum(bar105volume) / TotalSum(daycount);
def avgbar106 = TotalSum(bar106volume) / TotalSum(daycount);
def avgbar107 = TotalSum(bar107volume) / TotalSum(daycount);
def avgbar108 = TotalSum(bar108volume) / TotalSum(daycount);
def avgbar109 = TotalSum(bar109volume) / TotalSum(daycount);
def avgbar110 = TotalSum(bar110volume) / TotalSum(daycount);
def avgbar111 = TotalSum(bar111volume) / TotalSum(daycount);
def avgbar112 = TotalSum(bar112volume) / TotalSum(daycount);
def avgbar113 = TotalSum(bar113volume) / TotalSum(daycount);
def avgbar114 = TotalSum(bar114volume) / TotalSum(daycount);
def avgbar115 = TotalSum(bar115volume) / TotalSum(daycount);
def avgbar116 = TotalSum(bar116volume) / TotalSum(daycount);
def avgbar117 = TotalSum(bar117volume) / TotalSum(daycount);
def avgbar118 = TotalSum(bar118volume) / TotalSum(daycount);
def avgbar119 = TotalSum(bar119volume) / TotalSum(daycount);
def avgbar120 = TotalSum(bar120volume) / TotalSum(daycount);
def avgbar121 = TotalSum(bar121volume) / TotalSum(daycount);
def avgbar122 = TotalSum(bar122volume) / TotalSum(daycount);
def avgbar123 = TotalSum(bar123volume) / TotalSum(daycount);
def avgbar124 = TotalSum(bar124volume) / TotalSum(daycount);
def avgbar125 = TotalSum(bar125volume) / TotalSum(daycount);
def avgbar126 = TotalSum(bar126volume) / TotalSum(daycount);
def avgbar127 = TotalSum(bar127volume) / TotalSum(daycount);
def avgbar128 = TotalSum(bar128volume) / TotalSum(daycount);
def avgbar129 = TotalSum(bar129volume) / TotalSum(daycount);
def avgbar130 = TotalSum(bar130volume) / TotalSum(daycount);






plot AvgRelVol = if GetDay() != GetLastDay() then na
else if barcounter == 1 then avgbar1
else if barcounter == 2 then avgbar2
else if barcounter == 3 then avgbar3
else if barcounter == 4 then avgbar4
else if barcounter == 5 then avgbar5
else if barcounter == 6 then avgbar6
else if barcounter == 7 then avgbar7
else if barcounter == 8 then avgbar8
else if barcounter == 9 then avgbar9
else if barcounter == 10 then avgbar10
else if barcounter == 11 then avgbar11
else if barcounter == 12 then avgbar12
else if barcounter == 13 then avgbar13
else if barcounter == 14 then avgbar14
else if barcounter == 15 then avgbar15
else if barcounter == 16 then avgbar16
else if barcounter == 17 then avgbar17
else if barcounter == 18 then avgbar18
else if barcounter == 19 then avgbar19
else if barcounter == 20 then avgbar20
else if barcounter == 21 then avgbar21
else if barcounter == 22 then avgbar22
else if barcounter == 23 then avgbar23
else if barcounter == 24 then avgbar24
else if barcounter == 25 then avgbar25
else if barcounter == 26 then avgbar26
else if barcounter == 27 then avgbar27
else if barcounter == 28 then avgbar28
else if barcounter == 29 then avgbar29
else if barcounter == 30 then avgbar30
else if barcounter == 31 then avgbar31
else if barcounter == 32 then avgbar32
else if barcounter == 33 then avgbar33
else if barcounter == 34 then avgbar34
else if barcounter == 35 then avgbar35
else if barcounter == 36 then avgbar36
else if barcounter == 37 then avgbar37
else if barcounter == 38 then avgbar38
else if barcounter == 39 then avgbar39
else if barcounter == 40 then avgbar40
else if barcounter == 41 then avgbar41
else if barcounter == 42 then avgbar42
else if barcounter == 43 then avgbar43
else if barcounter == 44 then avgbar44
else if barcounter == 45 then avgbar45
else if barcounter == 46 then avgbar46
else if barcounter == 47 then avgbar47
else if barcounter == 48 then avgbar48
else if barcounter == 49 then avgbar49
else if barcounter == 50 then avgbar50
else if barcounter == 51 then avgbar51
else if barcounter == 52 then avgbar52
else if barcounter == 53 then avgbar53
else if barcounter == 54 then avgbar54
else if barcounter == 55 then avgbar55
else if barcounter == 56 then avgbar56
else if barcounter == 57 then avgbar57
else if barcounter == 58 then avgbar58
else if barcounter == 59 then avgbar59
else if barcounter == 60 then avgbar60
else if barcounter == 61 then avgbar61
else if barcounter == 62 then avgbar62
else if barcounter == 63 then avgbar63
else if barcounter == 64 then avgbar64
else if barcounter == 65 then avgbar65
else if barcounter == 66 then avgbar66
else if barcounter == 67 then avgbar67
else if barcounter == 68 then avgbar68
else if barcounter == 69 then avgbar69
else if barcounter == 70 then avgbar70
else if barcounter == 71 then avgbar71
else if barcounter == 72 then avgbar72
else if barcounter == 73 then avgbar73
else if barcounter == 74 then avgbar74
else if barcounter == 75 then avgbar75
else if barcounter == 76 then avgbar76
else if barcounter == 77 then avgbar77
else if barcounter == 78 then avgbar78
else if barcounter == 79 then avgbar79
else if barcounter == 80 then avgbar80
else if barcounter == 81 then avgbar81
else if barcounter == 82 then avgbar82
else if barcounter == 83 then avgbar83
else if barcounter == 84 then avgbar84
else if barcounter == 85 then avgbar85
else if barcounter == 86 then avgbar86
else if barcounter == 87 then avgbar87
else if barcounter == 88 then avgbar88
else if barcounter == 89 then avgbar89
else if barcounter == 90 then avgbar90
else if barcounter == 91 then avgbar91
else if barcounter == 92 then avgbar92
else if barcounter == 93 then avgbar93
else if barcounter == 94 then avgbar94
else if barcounter == 95 then avgbar95
else if barcounter == 96 then avgbar96
else if barcounter == 97 then avgbar97
else if barcounter == 98 then avgbar98
else if barcounter == 99 then avgbar99
else if barcounter == 100 then avgbar100
else if barcounter == 101 then avgbar101
else if barcounter == 102 then avgbar102
else if barcounter == 103 then avgbar103
else if barcounter == 104 then avgbar104
else if barcounter == 105 then avgbar105
else if barcounter == 106 then avgbar106
else if barcounter == 107 then avgbar107
else if barcounter == 108 then avgbar108
else if barcounter == 109 then avgbar109
else if barcounter == 110 then avgbar110
else if barcounter == 111 then avgbar111
else if barcounter == 112 then avgbar112
else if barcounter == 113 then avgbar113
else if barcounter == 114 then avgbar114
else if barcounter == 115 then avgbar115
else if barcounter == 116 then avgbar116
else if barcounter == 117 then avgbar117
else if barcounter == 118 then avgbar118
else if barcounter == 119 then avgbar119
else if barcounter == 120 then avgbar120
else if barcounter == 121 then avgbar121
else if barcounter == 122 then avgbar122
else if barcounter == 123 then avgbar123
else if barcounter == 124 then avgbar124
else if barcounter == 125 then avgbar125
else if barcounter == 126 then avgbar126
else if barcounter == 127 then avgbar127
else if barcounter == 128 then avgbar128
else if barcounter == 129 then avgbar129
else if barcounter == 130 then avgbar100

else na;

#AvgRelVol.AssignValueColor(if AvgRelVol <= low then  Color.cYAN else CreateColor( 0, 0, 1) );
#avgvol.setstyle(curve.points);
#AvgRelVol.SetLineWeight(1);
#plot zero = 0;
#AddCloud(AvgRelVol, zero, Color.GRAY);

plot vol = volume;
plot rv = round (volume/ AvgRelVol  , 0);
#AddLabel(yes,"   H_RVOL   " + rv +" ",  if volume > AvgRelVol then Color.mAGENTA else Color.GRAY);
 
Another version


Code:
 
# Comparison of Today's Volume at bar and Volume at time.

# Mobius

# V01.11.02.2017

# V02.11.02.2017 Revision to display On Volume and added a histogram to overlay current volume with pervious days volume.

 

declare On_Volume;

 

def v = volume;

def bar = barNumber();

def xBar = if SecondsTillTime(0930) == 0

                     then bar

                     else xBar[1];

def pxBar = if xBar != xBar[1]

                         then xBar[1]

                         else pxBar[1];

def zxBar = if SecondsFromTime(0930) >= 0 and

                       SecondsTillTime(1600) > 1

                    then 0

                    else if SecondsTillTime(1600) == 0

                        then bar 

                        else zxBar[1];

def pzxBar = if zxBar != zxBar[1]

                        then zxBar[1]

                        else pzxBar[1];

def pxBars = if bar == xBar

                   then pxBar 

                   else if bar >= xBar

                        then pxBars[1] + 1

                        else pxBars[1]; 

def length = bar - (pxBars-1);

def RelVol = if bar >= xBar

                    then getValue(v, length-1)

                    else 0;

def pVol = if bar == xBar

                    then 0

                    else if bar > xBar

                         then pVol[1] + RelVol

                         else pVol[1];

def tVol = if SecondsTillTime(0930) == 0

                then v

                else if SecondsFromTime(0930) > 0  and SecondsTillTime(1600) >= 0

                then compoundValue(1, tVol[1] + v, v)

                else tVol[1];

plot pVolHisto = if !isNaN(close) then RelVol else double.nan;

     pVolHisto.SetPaintingStrategy(PaintingStrategy.Squared_Histogram);

     pVolHisto.AssignValueColor(if RelVol > tVol[1]

                                then createColor(20,125,20)

                                else createColor(75,75,75));

addlabel(1, "yesterdays volume at bar = " + RelVol +

          "  yesterdays volume = " + pVol +

          "  todays volume = " + tVol,

          if tVol > pVol

          then color.green

          else color.red);

# End Code Previous Days Volume Comparison V02
 
def v_days_divisor = if v_days > 1 then (if v_eth_pre then v_days - 1 else v_days) else 1;

Its used in the calculation of v_avg_volume_001, v_avg_volume_002.........


Code:
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);
a bit confused, is this a complete script?
 

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