# Portfolio Design

Advanced concepts in stock investment portfolio design.  Fundamentals, technical analysis and many other related topics are discussed.

# The Problem With Conditional Nodes

While writing my last post I discovered a major issue with how Portfolio123 processes NAs in conjunction with Conditional Nodes within ranking systems. At least I view the issues as major, perhaps I was expecting too much.

The problem is that the Ranking System algorithm processes conditional nodes in a seemingly irrational fashion.  as an example, I created this very simple ranking system with one conditional node RSI(14)>50.  I used the stock factor SiRatio (Short Interest Ratio) for the TRUE condition.

For the FALSE condition, I used the formula (NA.).  The idea is to rank all stocks with RSI(14)<=50 at the bottom and the remainder at the top, ranked by SiRatio.

So what does actually happen?  Well have a look below...

The rankings for the stocks meeting the FALSE condition are placed at the top (rank=90).  The rankings for the stocks satisfying the TRUE condition are placed below those stocks meeting the FALSE condition.  For me this is counter-intuitive and it appears there is no way to get them placed at the bottom of the universe.  I've tried using the statement FALSE instead of NA, changing the node to Binary, etc.  This is a major problem and should be fixed by P123!