Plot a line at the high of the highest volume bar of a daily chart.


Category:
0
0

Hi Pete, is it posible to plot a line a the  at the high of highest volume bar     thanks.

Attachments:
Marked as spam
Posted by (Questions: 8, Answers: 23)
Asked on December 31, 2019 2:50 pm
199 views
0
Private answer

I think this should do it.

def highestVolume = HighestAll(volume);
rec trackHighest = if volume == highestVolume then high else trackHighest[1];
plot data = if trackHighest == 0 then Double.NaN else trackHighest;

Marked as spam
Posted by (Questions: 37, Answers: 4079)
Answered on December 31, 2019 3:36 pm
0
works great, Thanks Pete You are the man!
( at December 31, 2019 7:10 pm)
0
Hi Pete, is there a way to exclude the last bar in this study above? thank you very much for your time.
( at April 14, 2020 6:54 pm)
0

Probably something like this. I added a line to the begining and modified the first line from the answer above. The other two lines will remain as they are. This is only showing the modifications:

def lastBar = !IsNaN(close) and IsNaN(close[-1]);
def highestVolume = HighestAll(if !lastBar then volume else 0);

( at April 14, 2020 8:12 pm)
0
Thank so much works perfect, you are the Best!!!
( at April 14, 2020 9:03 pm)
0
Hi, I'm interested in this script. Would it be possible to extend this to find the 5 or 10 highest volume candles on the daily chart and plot those highs? Thanks!
( at May 28, 2020 12:43 pm)
0
Hi Pete, I added two separate studies on the chart which includes and excludes the last bar. I am still trying to figure out Omar's request of excluding the last bar. What purpose is served by excluding the last bar?
( at January 3, 2021 11:26 am)
0
I don't have a clue why that was requested. You will have to wait and see if Omar responds.
( at January 3, 2021 11:33 am)
0
Hi Pete I tried to use the logic from this but not able to get lines to extend on the right. trying something simple for example below if you can please help me find my mistake. Thanks input value = 80000; def paintbar = volume > value; plot insideHigh = if paintbar then high else Double.NaN; insideHigh.SetPaintingStrategy(PaintingStrategy.HORIZONTAL); insideHigh.SetDefaultColor(Color.CYAN); insideHigh.SetLineWeight(3); plot insideLow = if paintbar then low else Double.NaN; insideLow.SetPaintingStrategy(PaintingStrategy.HORIZONTAL); insideLow.SetDefaultColor(Color.MAGENTA); insideLow.SetLineWeight(3); AddCloud(insideHigh, insideLow, Color.GRAY, Color.BLACK); Also how can today or last 2 days only can be added to this logic input timeFrame = AggregationPeriod.DAY; input showOnlyToday = no;
( at May 16, 2022 4:41 am)
0
There is nothing in the code you provided that implements any of the logic demonstrated in my solution to this post.
( at May 16, 2022 7:56 am)
0
Thanks Pete, should i create a new question for this? That code i pasted shows the line on top and bottom of that bar but it doesn't extend on the chart.
( at May 16, 2022 8:19 am)
0
Sorry but that request does not fit the goals of this forum. Why? Your request includes a fixed value for volume, an arbitrary value of 80,000. Such a solution would only apply to a very small number of stocks and would not be suitable as a solution which benefits the majority of our viewers. This forum is intended to provide solutions to the most common questions among traders and will be useful to the majority of our viewers.
( at May 16, 2022 1:49 pm)
0
I will also add that the way you are trying to go about this is not compatible with the technique employed in the solution to this question. Your approach marks several bars on the chart, making it impossible to extend those lines all the way to the right. The solution provided in this question will only apply to one solitary bar on the chart. You did not include a full description of what you are trying to achieve but I can tell from the code you attempted to write that it will not be possible to do what you have intended. You must narrow your scope to a condition that will pick only one solitary bar on the chart.
( at May 16, 2022 3:20 pm)
0
Thanks Pete, i also did get same multiple bar result.
( at May 27, 2022 5:10 am)