Comparing valuations to historical levels

How would I write a buy rule to find when a datapoint is within x% of its historical lows? For example, let’s say I wanted to find stocks where the price/tangible book value is within 10% of the previous low?

Thanks.

If life were easy, you could write something like;

Pr2TanBk(0,QTR)/LoopMin("Pr2TanBk(CTR,QTR)",12,0)<1.10

But none of the P123 provided ‘Price To *’ functions support calls like function(offset,type[,NAHandling]).

You could try and build it up with TanBV(CTR,QTR) and MktCap, but you would need to get historic values for MktCap. There are forum posts that outline how to do that w/ with SharesCur() and Close().

I think with enough hacking, you could find a complete solution.

Walter

Thanks Walter. Yes, this could get cumbersome. Maybe some hacking will get me there.

A couple questions …

  1. It looks like this sample formula searches the prior 12 quarters. Am I reading that correctly? If so, is that the limitation? I’d need something more like 10 years+.

  2. What about the FHist function? Would that be helpful, and if so what would the buy rule look like?

Thx.

Yes, you’re reading is correctly. There are P123 built in limitations to lookback. It think it may be 20 quarters, but I’m not really sure.

I think you’ll run into the classic function w/ quoted args embedded in a function w/ quoted args problem.

Actions like what you want should be easier to do. Just sayin’

Walter

Ok thanks. Yes, agreed.

Even VB supports nested quotes.

Just saying.

Use two buy rules:
Pr2TanBkQ/Min(FHist(“Pr2TanBkQ”,10),FHist(“Pr2TanBkQ”,20),FHist(“Pr2TanBkQ”,30),FHist(“Pr2TanBkQ”,40),FHist(“Pr2TanBkQ”,50),FHist(“Pr2TanBkQ”,60),FHist(“Pr2TanBkQ”,70),FHist(“Pr2TanBkQ”,80),FHist(“Pr2TanBkQ”,90),FHist(“Pr2TanBkQ”,100),FHist(“Pr2TanBkQ”,110),FHist(“Pr2TanBkQ”,120),FHist(“Pr2TanBkQ”,130),FHist(“Pr2TanBkQ”,140),FHist(“Pr2TanBkQ”,150),FHist(“Pr2TanBkQ”,160),FHist(“Pr2TanBkQ”,170),FHist(“Pr2TanBkQ”,180),FHist(“Pr2TanBkQ”,190),FHist(“Pr2TanBkQ”,200)) <= 1.1
and
Pr2TanBkQ/Min(FHist(“Pr2TanBkQ”,210),FHist(“Pr2TanBkQ”,220),FHist(“Pr2TanBkQ”,230),FHist(“Pr2TanBkQ”,240),FHist(“Pr2TanBkQ”,250),FHist(“Pr2TanBkQ”,260),FHist(“Pr2TanBkQ”,270),FHist(“Pr2TanBkQ”,280),FHist(“Pr2TanBkQ”,290),FHist(“Pr2TanBkQ”,300),FHist(“Pr2TanBkQ”,310),FHist(“Pr2TanBkQ”,320),FHist(“Pr2TanBkQ”,330),FHist(“Pr2TanBkQ”,340),FHist(“Pr2TanBkQ”,350),FHist(“Pr2TanBkQ”,360),FHist(“Pr2TanBkQ”,370),FHist(“Pr2TanBkQ”,380),FHist(“Pr2TanBkQ”,390),FHist(“Pr2TanBkQ”,400)) <= 1.1
If you apply those to the “All Fundamentals” universe, you get 302 stocks. One of them is Wells Fargo.