Exploration Barssince 52 week High

I am trying to find the bar counts since 52 week high, but it is not returning me the expected results. Could you help?

Filter= 1;
AddColumn(C, "Close");
AddColumn (Ref(C,-15), "15D",1.2);
AddColumn (HHV(High,252),"52W High",1.2);// 52 week High
AddColumn(BarsSince(HHV(High,252)),"Barsince 52WH",1.2);// No. of Barssince 52 week high

@av.ragavan

Here is a hint.... Look at the Help manual for BarsSince, and what the output of the HHV is.

Hopefully that will give you the push in the right direction.

Filter= 1;
AddColumn(C, "Close");
AddColumn (Ref(C,-15), "15D",1.2);
AddColumn (HHV(High,252),"52W High",1.2);// 52 week High
AddColumn (HHVBars(High,252) ,"Barsince 52WH",1.2);// No. of Barssince 52 week high

This one is working.

@av.ragavan,

Way to go. Hope I was helpful.

You should mark your post as solution, so others can find and see it.

1 Like

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