How to plot price at hhv(v,4),-1)

Hi

I want to be able to generate a plot that only plots the closing price when the volume of that day is greater than the previous 4 days. Any assistance much appreciated - thanks

x = ValueWhen(V == HHV(V,5), Close);
Plot( x, "Price", colorDefault, styleLine );

Or use IIf()

x = IIF(V == HHV(V,5), Close, Null);
Plot( x, "Price", colorDefault, styleDots );

or use SparseCompress()

x = SparseCompress(V == HHV(V,5), Close);
Plot( x, "Price", colorDefault, styleLine );
1 Like

Many thanks fxshrat, much appreciated :smile: