Number of bars since days highest high

#1
Hi,
Trying to get number of bars since highest high of the day.
I got correctly Highest high value of the day:
Code:
newDay = dn != Ref( dn, -1 );
highestNewDay = HighestSince(newDay, H)
Can not figure out how to get number of bars:
Code:
bars_since_hh = BarsSince(HHCondition???);
Any ideas?
 

stoch

Active Member
#2
Time of highest high? You get timestamp of the event and then use it as a variable. Or for example if trading session is N hours with total T bars and event of highest high is 3 hrs after session start, then number of bars is (N hours - 3 - time left for the session end)/N multiplied by T