Handling of NAs

is there way to create a buy rule where a stock that has more than X number of NAs, is excluded as a buy?

There's no built-in function today that exposes the number of NAs a stock encounters in a ranking system for use in buy/sell rules.

The closest workaround is to manually check each factor with IsNA() and sum them up:

eval(IsNA(PEExclXorTTM), 1, 0) + eval(IsNA(ROE%Q), 1, 0) + eval(IsNA(AvgRec), 1, 0) < 3

This is obviously tedious if your ranking system has many factors, and it won't stay in sync automatically if you change the ranking system later.

A native function along the lines of RankNaCount("MyRankingSystem") that returns the per-stock NA count for use in buy/sell rules would be a natural extension. Might be worth a Feature Request post if there's interest.

1 Like

@falnu some time ago I did the request :grin:

You could vote for it :smiley:

@ScifoSpace How do I vote for it? Claude can’t understand why its not yet a buy rule since P123 calculates it for rank performance testing.

Click in the link in the previous mail and in the upper part you can vote

Anyway in the thread of the votation there are a few interesting ideas

1 Like