Modern portfolio theory outlined the concept of periodically rebalancing a portfolio to manage risk, and to safeguard against becoming overexposed to a particular asset type. Balanced portfolios always stay 100% invested, but periodically sell off shares of an asset that has outperformed, using the proceeds to purchase another asset whose weight in the portfolio has diminished.
The concept of balancing a portfolio that is 100% invested is also manifested in stock rotation strategies like Dogs of the Dow. This strategy rebalances annually, and buys the 10 stocks of the Dow 30 that have the highest dividend yields.
Traditional backtesting software often makes it difficult to implement a strategy that rebalances a portfolio that is 100% invested. It’s easy, for example, to create a strategy that buys and sells a stock based on a moving average crossover, but harder to model a strategy that seeks to buy the top 10 stocks in a universe of candidates, based on some criteria.
By using static variables, it would be possible to code a stock rotation model in Quantacula. However, we provided a dedicated Rotation Model to make the task far less complex, at least for certain scenarios.
Rotation Models are a dedicated type of trading model in Quantacula, alongside their siblings the Building Block Models and C# Coded Models. They work by letting you establish a Weight Factor (expressed as a Quantacula indicator) and maintain a portfolio of the N stocks with the highest or lowest weight factor values. Rotation Models have the following parameters:
Weight Factor – any Quantacula indicator
How many Symbols – you control how many symbols to be invested in
Highest/Lowest -indicate whether the symbols with the highest or lowest Weight Values should be purchased
Rebalance Frequency – you can rebalance the portfolio daily, weekly, monthly, etc.
Rotation Models are a great tool for evaluating the effectiveness of technical indicators, particularly oscillators. One standard interpretation of oscillators is that they indicate oversold levels when they move below a certain value, and overbought levels when they move above a value. This naturally fits into Quantacula's Rotation Models, and we can use an oscillator as the model's Weight Factor.
In the example below, we use a 14 period Relative Strength Index (RSI) on the most recent 10-year history of the Nasdaq 100 stocks, buying the 3 stocks in the index with the lowest RSI, and rebalancing daily. Commission of $4.95 per trade was used. We used an intelligent QPremium Nasdaq 100 watchlist to avoid the problem of survivorship bias and get the most accurate backtest results possible.
Rotating into the stocks with the lowest RSI resulted in a net profit of 452% over the past 10 years, outperforming the SPY benchmark of 222%. Let's see what happens if we instead flip the logic and always buy the 3 stocks that have the highest RSI.
That is quite a difference, with the net profit dropping to 110% and losing out to SPY. This is vivid proof of the old market adage, "buy low, sell high". Being able to quickly validate this market concept with a couple of Rotation Models in Quantacula Studio is a powerful tool for the technical analyst or trader. The ability to evaluate other indicators is simply a matter of changing the Weight Indicator. And, if you want to evaluate more complex criteria, they could always be boiled down to custom Quantacula indicator and dropped into a Rotation Model.