Highest Volume Bar - Intra day

I would like to get some indication in chart

  1. First Highest volume Bar
  2. second Highest Volume Bar

I am new and trying with HHV function but unable to figure out. Appreciate you guys help…

my take

Bars_so_far_today = 1 + BarsSince( Day() != Ref(Day(), -1));
StartBar = ValueWhen(TimeNum() == 091500, BarIndex());

IIf (BarIndex() >= StartBar, HiVolBar1 =  HHV( V, Bars_so_far_today  ),0);

high1 = HHV( High , Bars_so_far_today );
low1 = LLV( Low,   Bars_so_far_today );


PlotShapes(shapeDigit1*high1 ,colorBrightGreen , 0, L, -5);

Not tested, but might give you ideas how to do what you want.

NewDay = Day() != Ref(Day(), -1);
Bars_so_far_today = 1 + BarsSince( NewDay);
bi = BarIndex();
StartBar = ValueWhen(TimeNum() == 091500, bi);

high1 = bi >= StartBar AND Volume >= HHV( Volume, Bars_so_far_today );
low1 = bi >= StartBar AND Volume <= LLV( Volume, Bars_so_far_today );

PlotShapes(shapeSmallCircle*high1,colorBrightGreen, 0, L, -5);
1 Like

Thanks awilson . Appreciate your time . But no luck ..please see the chart

image

works for me

SetChartOptions(0,chartShowArrows|chartShowDates);
_N(Title = StrFormat("{{NAME}} - {{INTERVAL}} {{DATE}} Open %g, Hi %g, Lo %g, Close %g (%.1f%%) {{VALUES}}", O, H, L, C, SelectedValue( ROC( C, 1 ) ) ));
Plot( C, "Close", ParamColor("Color", colorDefault ), styleNoTitle | ParamStyle("Style") | GetPriceStyle() ); 

NewDay = Day() != Ref(Day(), -1);
Bars_so_far_today = 1 + BarsSince( NewDay);
bi = BarIndex();
StartBar = ValueWhen(TimeNum() == 091500, bi);

high1 = bi >= StartBar AND Volume >= HHV( Volume, Bars_so_far_today );
low1 = bi >= StartBar AND Volume <= LLV( Volume, Bars_so_far_today );

PlotShapes(shapeSmallCircle*high1,colorBrightGreen, 0, L, -5);
1 Like

hmm..Not for me .. Am i doing any wrong ? Please advise

image

Read this

and check StartBar

I read it and pretty sure need to go through couple of times to absorb it . If you have time, could u please give me a clue what shall i look for in Start bar ? I will try to take it from there

PlotShapes will only plot something if high1 evaluates to true.

high1 has 2 conditions that must be true.
Check which condition is not true at the candle you think it should plot something

1 Like
  1. Volume >= HHV( Volume, Bars_so_far_today ) …Volume is greater than or equal to highest value in total number of bars today

  2. bi >= StartBar … is the the condition to check today’s first bar onwards and … bi is Barindex …means "returns zero-based bar number " …that means b i>= 0 onwards

This is my understanding and looks ok to my untrained brain… which is not obviously … Most likely its no2) …since you already gave a clue in the post before …

may be this one
StartBar = ValueWhen(TimeNum() == 091500, bi);

is StartBar array is storing Price info at 9:15 ? …

Really appreciate your time

1 Like

You really need this (NOT only to READ, but to IMPLEMENT the advice):

@Tomasz, Agree Totally . As i am a non-techie guy , it may take couple of weeks/months to gets basics i guess .

@awilson , please advise what was wrong or what do i need to change ?

@amsai you have to debug the afl so you can find where is the problem.

if you remove the first condition of high1, do you see any circle ?

//high1 = bi >= StartBar AND Volume >= HHV( Volume, Bars_so_far_today );
high1 = Volume >= HHV( Volume, Bars_so_far_today );
1 Like

Sure . I will start doing it. .. I do see circle now. Thank you. It is showing indication at first highest volume bar and then any bar higher volume than that first bar. I am happy with result . But i thought code suppose to pickup only one highest volume .. Thanks for your time and patience

image

I’m trying to work out how to calculate HHV of Volume Bar Of "Previous day" in an intraday timeframe, e.g. 5mins chart. I would appreciate If anyone has code to share or could guide me on how to do this.
Regards, Nick.

@Nick1985, What have you tried?

As a new member of the forum, you need to do a bit of homework.




This thread and the other thread you posted the same question on have some sample code. Show us what you have done with that, and you will probably get more people willing to help.

@Nick1985: Please don't post the same question in multiple threads. That just wastes people's time.

2 Likes

Ok Sir,
But can you please help me with the code?

Sir,
I tried using following code, but not working.

YDay = Ref(Day(),-1);
Bars_so_far_yday = BarsSince(YDay);
High2 = HHV( Volume, Bars_so_far_yday );

YDay = Day() != Ref(Day(),-1);
Bars_so_far_yday = BarsSince(YDay);
High2 = HHV( Volume, Bars_so_far_yday );

I think the response from @awilson will give you the highest volume so far today. To get yesterday's highest volume, I think something like this untested snippet should work:

dailyMaxVolume = TimeFrameCompress(V, inDaily, compressHigh);
prevDayMaxVolume = TimeFrameExpand(Ref(dailyMaxVolume ,-1), inDaily, expandFirst);