--- In [email protected], "Padhu" <[EMAIL PROTECTED]> wrote: > > Folks: > > How to find out when a new 52 week Low was set in the past 90 days?. I'd like to find the date or the barssince this occured. > > > > FiftyTwoWeek_Low=L <=LLV(low,252); > > FiftyTwoWeek_Low_New=FiftyTwoWeek_Low and Ref(FiftyTwoWeek_Low,-1) ==0; > > > > But once a new 52 week low is cut below, new 52 week low emerges and if trend continues, we will have new 52 week lows everyday. > > What I am looking for is the VERY FIRST occurance of the "FiftyTwoWeek_Low_New" in the past 90 days. > > > > Any thoughts on this?. > > > > Thanks,Padhu >
Heres another approach (I am working on the high side but it is just the same if reversed for the Lo). //P_HigherHiPeriods NewHi = H > HHV(Ref(H, -1), 250) AND BarIndex() > 250; Tally = Cum(NewHi); Plot(Tally,"Tally",1,1); NH = IIf(Tally > Ref(Tally,-1), BarsSince(Ref(Tally,-2)<Ref(Tally,- 1)),0); Plot(NH,"BarsSince",5,1|styleOwnScale); As it is it will give you the start of a series of new highs (it ignores the rest in the series) and how many bars since the end of the last series (refer to Plot(NH). I am pretty certain that a relatively simple variation will give you the first occurrence of a new high(periods) in the last x number of days. brian_z
