Portfolio Design

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

Advanced Ranking System Optimization

Advanced Ranking System Design

In this post I am going to show off a really cool (beyond cool actually) technique for creating very compelling Portfolio123 stock trading systems in a relatively short amount of time. Very optimized, probably way over-optimized, but also very interesting none the less.

For me this is magic, I'm a kid in candy shop, for now I can create powerful stock trading systems in one day that I couldn't achieve in years of trying. You too can do the same. The only limitation is your own creativity.

Before I Start

Please make sure you have read the series of tutorials on the Portfolio123 Ranking System Optimizer before this post. I don't plan on rehashing the details of how to run the optimizer and the EXCEL spreadsheet so you will get confused pretty fast.  So now I am going to jump right in.  Fasten your seatbelts...

Choosing a Stock Universe

I like the Standard & Poor stock universes for a variety of reasons.  The most compelling reason is the quality of stocks, all of which have headquarters in the USA.  I chose the S&P 1500 for this project and set the minimum stock liquidity at $2M dollar-volume with minimum stock price of $1.50.

Choosing Stock Factors

The first step is to choose 15 or less broad stock factors that you are relatively comfortable with.  In this example, I chose 14 factors.  I spent no more than an hour on this activity. For more serious design efforts I would generally spend a lot of time up front on the factors.

For this project I have duplicated the ranking system several times for a total of six ranking systems. Four of the ranking systems are for the four quarters of the year, and two ranking systems are for strong rising / falling interest rates.  But before copying the ranking systems, all stock factors must be converted to stock formulae with an Eval function as shown below for Quarter 1 (Q1).

Creating Six Independent Ranking Systems

All fourteen (14) of the stock formula must call out the Eval function.  If the equation (Month<4) is FALSE then all stocks in the universe will be assigned an NA.  If the equation is TRUE then the stock factor is calculated for each stock in the universe.  The ranking system is set up so that NAs are put at the bottom of the ranking performance.

The other ranking systems are as shown below.

Rising Interest.jpg
Falling Interest.jpg

Optimizing and Creating the Final Ranking System

Now, by following the Ranking System optimizer tutorials with weekly rebalance, I was able to optimize all six ranking systems, not only boosting their performance but also pruning many factors. When I was finished optimizing all of the ranking systems I combined the six ranking systems into one and removed the Eval functions as shown below.

Final Ranking System.jpg

Note that each ranking system is assigned a node weight of 1%.  This is the minimum node weight allowable while being able to reference the node later in the ranking system using the function NodeRank("Node Name").  The six nodes representing the individual ranking systems combine for a total weight of 6%.  These nodes are always active.  The remaining 94% makes up the dynamic part of the ranking system that changes with season and strong interest rate movement. The dynamic part of the ranking system was created using a conditional node. 


 For normal market conditions, defined as #TNX within certain bounds of movement over three months, seasonal factors are in play.  Otherwise, rising or falling interest rate factors are in play.

Final Ranking System Normal Conditions.jpg

Otherwise, rising or falling interest rate factors are in play.

Final Ranking System Interest Rates.jpg

Ranking System Performance

The next step is to test the performance using the Ranking System Performance page. 

Keep in mind that the performance was tested using the S&P 1500 stock universe with liquidity of $2M.  So this is not too shabby.

Final System

Most of the work has been done within the ranking system.  This makes the final system design very easy.  With a few standard buy/sell rules I managed to get a very nice looking 10 stock simulation.

This entire process took less than one day from start to finish.  One deficiency is that sector weight control does not work very well so I still have work to do.  But other than that the results are not bad.

by Steve Auger