hello,
you wrote a lot of words and i'm still not sure what you want.
please allow me to point out some things , that will help you make better posts in the future.
you said you don't want a vol spike, then proceeded to describe a vol spike.
you talked about volume , then complicated things by mentioning another unit, contracts.
you mentioned contracts exchanged, but didn't mention a time period of when this quantity is supposed to happen?
1 bar, 10 bars, bars elapsed in current day,...
you show a picture, of 2 charts, so i don't know which one i am supposed to look at. you assumed we can zoom in and read them. on my cell, it is hard to read tiny fonts. you didn't mark it up, to focus our eyes on the desired section. the 2 charts are not synced to the same time of the x-axis, the bottom one is shifted, so that adds confusion.
you chopped off the y axis, so i don't know the units, so i can't tell what bar has the desired value. i can almost read the times on the x axis , so i could guess at which bar it is.
i use the snipping tool to grab part of a screen image and mark it up..
https://www.digitalcitizen.life/how-use-snipping-tool/
if you don't want to find a spike, then i guess you want,
to add up volume from all the bars after the open of the day,
and compare that quantity to some number that the user picks.
----------------------------
that link that benten provided probably has something that would work,
but i wanted to give you feedback on the post, and went ahead and made this.
----------------------------
my guess on what you want
on the beginning of each day, a volume counter resets and adds up the volume during the day.
when that accumulated volume is >= some number, then
..an alert is triggered
options,
..yellow arrow above the volume bar
..a yellow box is drawn around the volume bar
can show a test bubble that displays the volume numbers
i was testing with SP100 stocks, stocks with volume, so i set the default trigger volume to be 300k.
change this line if you want something different,
input vol_qty = 300000;
Code:
#vol_accumm_day_00
#https://usethinkscript.com/threads/option-volume-alert.14853/#post-121891
#Option Volume Alert
def na = double.nan;
#def bn = barnumber();
input vol_qty = 300000;
def newday = (getday() <> getday()[1]);
#def istoday = (GetLastDay() == GetDay());
def dayvol = if newday then volume else dayvol[1] + volume;
def x = if newday and dayvol > vol_qty then 1 else
if dayvol[1] < vol_qty and dayvol >= vol_qty then 1
else 0;
alert(x, "vol up", alert.bar, sound.ding);
input show_arrow_big_volume = yes;
plot z5 = if show_arrow_big_volume and x then volume*1.1 else na;
z5.SetPaintingStrategy(PaintingStrategy.ARROW_DOWN);
z5.SetDefaultColor(Color.yellow);
z5.setlineweight(2);
z5.hidebubble();
#------------------------------
input show_yellow_box_on_big_volume = yes;
#https://usethinkscript.com/threads/draw-an-overnight-box-on-intraday-futures-for-thinkorswim.2087/page-3#post-58481
# post49 draw box around a candle
#input charttype = ChartType.CANDLE;
def condition = x;
def v = volume;
def o1 = if condition and show_yellow_box_on_big_volume then v*1.2 else na;
def c1 = if condition and show_yellow_box_on_big_volume then 0 - (v*0.2) else na;
def h1 = if condition then v*1.2 else na;
def l1 = if condition then 0 - (v*0.2) else na;
DefineGlobalColor(color = Color.YELLOW, name = "Box");
AddChart(growcolor = GlobalColor("Box"), high = h1, low = l1, open = c1, close = o1, type = charttype.candle);
#---------------------------
# test stuff
input test_vol_qty = no;
addchartbubble( test_vol_qty, 0,
dayvol + "\n" +
vol_qty
, ( if x then color.yellow else color.gray), no);
#
#
red lines indicate a new day