Plot line at high of bar with highest volume


Category:
0
0

I am currently using this script https://www.hahn-tech.com/ans/highest-volume-bar-of-the-day/

I was wondering if there was a way to plot a horizontal line on the highest volume bar as well

 

Marked as spam
Posted by Reese Staats (Questions: 1, Answers: 1)
Asked on April 4, 2021 7:27 am
203 views
0
Private answer

I updated the title of your question to include the details that I believe was lacking. But I'm not exactly certain because you only said you wanted a horizontal line plotted for the highest volume bar. You did not state whether this was supposed to be the open, high, low or close of that bar. So I selected the high for this solution.

You can accomplish this by adding the following line of code to the solution in the link your provided in your question:

plot data = HighestAll(if volume == highest then high else 0);

 

Marked as spam
Posted by Pete Hahn (Questions: 37, Answers: 4153)
Answered on April 4, 2021 4:11 pm
0
hi Mr. Hahn thank you for the help.. I put the code in my current volume script and it doesn't seem to be plotting the highest volume bar, maybe I am doing something wrong? I will attach a screenshot as what I would like to happen with the script, which is plot a line/horizontal line on the highest volume bar if that is possible?
(Reese Staats at April 5, 2021 9:42 am)
0
here is the script I am using declare lower; declare zerobase; input length = 50; plot Vol = volume; plot VolAvg = Average(volume, length); Vol.SetPaintingStrategy(PaintingStrategy.HISTOGRAM); Vol.SetLineWeight(3); Vol.DefineColor("Up", Color.UPTICK); Vol.DefineColor("Down", Color.DOWNTICK); Vol.AssignValueColor(if close>=open then Vol.color("Up") else Vol.color("Down")); VolAvg.SetDefaultColor(GetColor(8)); def day = GetDay(); def lastDay = GetLastDay(); def isToday = If(day == lastDay, 1, 0); def highest = if isToday and volume > highest[1] then volume else highest[1]; def scan= highest; AddLabel (yes, "VOLUME HIGHEST=" + highest, color.white); plot data = HighestAll(if volume == highest then high else 0); Plot line = 100000;
(Reese Staats at April 5, 2021 9:42 am)
0
The solution I provided only works for the code that was provided in the previous question you linked to in your question. You have modified that code to do something entirely different and it is not possible to get your modified code to perform as you requested.
(Pete Hahn at April 5, 2021 11:03 am)