Hi all,

I recently read the book “Unholy Grails” by Nick Radge and found it was brilliant. It had some great discussion on developing momentum strategies and some examples.

I decided to backtest one of the strategies in the book on the S&P500 and share the results on this forum. I am quite new to coding and quantitative finance and hope this discussion helps people in similar situations to me.

The basis of the strategy is to buy stocks on the open of the next day when the stock makes a new high in the last year (250 trading days). Then we sell the stock once it falls below the lowest price in the last year, which is hopefully higher than the entry price. We hold 20 positions at a time and set a stop loss at 20% below the entry price. This way, we only lose 1% of our account size on each wrong trade.

The S&P500 universe (Quantconnect equivalent) is used and the stocks are sorted by Market Cap.

As I mentioned I am fairly new to this and I am sure there are some improvements to be made in the script. I do appreciate any feedback.

Author