Top decile ROC backtest
Author: farnam_street
Creation Date: 5/3/2020 1:33 AM
profile picture

farnam_street

#1
I would like to backtest a stock portfolio that has the top 10% performers in an index measured by ROC. The portfolio is rebalances every month. Are there any examples that show how this can be setup?
profile picture

Eugene

#2
Of course. Take Weak-stock rotation, for example. You have to make just a slight change to the code to invert it from rotating into the weakest stocks to rotating into the top performers:

CODE:
Please log in to see this code.


Change the number of stocks to rotate into via the param slider at the bottom.

More strategies of the same kind, Fidelity Select Sector Fund Rotation System and Tactical Asset Rotation, are already set to use the highest ROC or an average of ROC (different periods) for rotation.

P.S. You might also want to see the Wiki FAQ | Strategies and WealthScript > "Rotation strategies" > "I need other rotation rule other than the built-in RSI."
This website uses cookies to improve your experience. We'll assume you're ok with that, but you can opt-out if you wish (Read more).