Highest high volume of last 'n' days

Buy = volume > Ref (volume, -5)

This condition will give the result of Today's volume greater than last 5 days volume. In this case if any of the last 5 days has low volume then today's volume will show as highest.

I want to scan today's volume must be highest high of the last 5 days volume. I tried using HHV function, but not successful.

Can any one please tell me how to write the condition to find today's volume must be highest high volume of last 5 days?

Thanks,

Let me give a try to see if I have learned anything today from @fxshrat:
If I am wrong, surely someone will correct me.

Try this:

hh = HHV(Volume, 5);
Buy = Volume > Ref(hh, 1);

Thanks @camo. When running the formula it showing nothing. Actually, in the ticker there is a greater volume than last 5 days. But not showing in the results panel.

@cameo

You are looking into future. To look backwards via Ref you have to use negative value as second argument of Ref.

hh = HHV(Volume, 5);
Buy = Volume > Ref(hh, -1);

Also please use code tags when inserting code.

3 Likes

Noted.
Willdo. And thank you, @fxshrat

@fxshrat as usual perfect. Thank you.

This topic was automatically closed 100 days after the last reply. New replies are no longer allowed.