you didnt specify when relative volume makes a new high, so i assumed you meant in the same day.
the code below rarely triggers, so i left out the first study of new high but price does not. if you want to include the first study simply change
plot greenArrow = hhBar;
to
plot greenArrow = hhBar and study1;
Code:
declare lower;
input Opentime1 = 0930;
input Endtime1 = 1600;
def ActiveTime = if GetLastDay() == GetDay() and SecondsFromTime(Opentime1) >= 0 and SecondsFromTime(Endtime1) < 0 then 1 else 0;
input length = 60;
input numDev = 2.0;
input allowNegativeValues = no;
def rawRelVol = (volume - Average(volume, length)) / StDev(volume, length);
plot RelVol = if allowNegativeValues then rawRelVol else Max(0, rawRelVol);
def study1 = close is less than high within 8 bars;
plot highestrelvolofday = highestall(if GetLastDay() == GetDay() and highestall(relvol) then (relvol) else double.nan);
def hhBar = if relvol==highestrelvolofday then BarNumber() else hhBar[1];
plot scan = hhbar;
RelVol.SetPaintingStrategy(PaintingStrategy.HISTOGRAM);
RelVol.SetLineWeight(3);
RelVol.DefineColor("Above", GetColor(0));
RelVol.DefineColor("Below", GetColor(2));
RelVol.AssignValueColor(if RelVol >= numDev then RelVol.Color("Above") else RelVol.Color("Below"));
plot greenArrow = hhBar;
greenArrow.SetDefaultColor(Color.GREEN);
greenArrow.SetPaintingStrategy(PaintingStrategy.ARROW_UP);