Maximum lookback for "highval" and "lowval"

One of my new favorite factors/rules I’m playing with is lowval and highval. They return the lowest (highest) closing price over a given period.

My understanding is that the lookback period is limited to 2500 bars, about 10 years. I would love to extend this to the full dataset since 1999 - is there a way to modify to use say weeks, to get the highest/lowest price in a given week instead?

Or some other workaround?

Thanks in advance!

Cheers,
Ryan

Should be easy to add a weekly option for those functions, and any function that has a series parameter.

Thanks for the suggestion.

And here’s a workaround. Just run this rule in the screener

@20YHi:FHistMax(“Price”,130,8)

It’s the max close price sampled 130 times 8 weeks apart, or a span or 1040 weeks = ~20Y

NOTE:FHistMax by default returns NA if more than 20% of the samples are NA

Thanks Marco, this works. As you mentioned, the limitation is any stocks with less than 80% of the total days will come out as NA.

What I’m specifically trying to do is find extreme multibaggers, i.e. 10x, 50x, 100x etc since 1999. I can break out the end dates to overcome the lowval/FHist limiations, but was hoping to find a way to do it with the same end date.

Any other thoughts would be welcome!

Thanks,
Ryan

you can change NA limit up to 80%. It’s the last parameter that defaults to 20.

So FHistMax(“Price”,130,8,50) will find the high price for stocks that have 5y or more of price data