Magic / Free Form Code

Hello,

Imagine i want to select the lowest 20% of P/B stocks.

With the Magic Wand, i select Price to Book : best in the industry, less than 20.
But when i click on the “Free Form Code” button, it gaves me: Frank(“Pr2BookQ”,#Industry,#ASC)>(100-(20))
I imagine the “right” code should be Frank(“Pr2BookQ”,#Industry,#ASC)<20.
I am right (cause i like to use free form code) ?

One thing to note is that #ASC means ‘lower is better’. So lower price to book stocks will get a higher rank. So they way you have it, I think you will be getting very high price to book stocks.

I think you want to switch #asc to #desc for the way you have it. Or just use theirs.

frank(“pr2bookq”,#industry,#desc)<20

Or just leave out the #desc as that should be default. The way that had it is not wrong. But it might look counter-intuitive.

With value ratios it’s important to keep the direction (#asc, #desc) right. If you’re looking for the lowest 20% of price-to-book, you want stocks that rank 80 or better on “low price-to-book” rather than stocks that rank 20 or worse on “high price-to-book.” Why? Because with FRank, N/As get the lowest numbers. So FRank(“Pr2BookQ”,#Industry,#Asc) > 80 will exlcude N/As but FRank(“Pr2BookQ”,#Industry,#Desc) < 20 will include N/As.

Hi, Thanks for your responses: i will work on them to understand clearly how the formula works.
The website is very well done and very interesting: tons of test to do. That’s great. I will probably have another question soonly…