We are starting this new discussion for sharing an updated version of the momentum strategy from Andreas F. Clenow’s book Stocks on the Move: Beating the Market with Hedge Fund Momentum Strategy. I would highly recommend reading Clenow’s book to undestand the strategy details, even though we summarize in this post the main investment rules that Mr. Clenow structured very simply in different chapters for enabling a reasoned and a clear understanding.
Implementations have previously been carried out on other platforms and the simplicity and robustness of the strategy has been discussed too. It is worth highlighting the implementation of Teddy Koker on Python here or that of Felix Bertram in C# here. Additionally, you can find old implementations in Quantconnect from which we have based the one we share today.
- https://www.quantconnect.com/forum/discussion/3136/andreas-f-clenow-momentum/p1
- https://www.quantconnect.com/forum/discussion/10493/andreas-clenow-momentum-strategy-using-framework-from-stocks-on-the-move-book/p1
- https://www.quantconnect.com/forum/discussion/3106/stocks-on-the-move-equity-momentum/p1
The algorithm's objective is to select stocks from the SP500 universe with the fastest rising prices while maintaining limited volatility. The key rules are:
- Market Universe: It operates within the SP500 universe.
- Trading Schedule: Trades are executed on Wednesday
- Regular Selling/Buying: Stocks are bought and sold every week.
- Rebalancing: Positions are rebalanced twice a month to manage risk.
- Top Ranking Stocks: The algorithm selects the top 100 (or 20%) ranked stocks from the SP500.
- Moving Average Filter: Stocks below their 100-day moving average are sold.
- Gap Filter: Stocks with a gap of more than 15% over the last 90 days are not bought.
- Index Membership Filter: Stocks that leave the SP500 index are sold.
- Market Regime Filter: Stocks are bought only when the SP500 is above its 200-day moving average.
- Position Sizing: Position sizes are calculated based on a 0.1% risk of the total portfolio value using the Average True Range (ATR) of the last 20 days.
- Momentum Calculation: Momentum is calculated based on the annualized exponential regression slope over the past 90 days.
- Momentum Weighting: Momentum values are weighted for volatility adjustment using the coefficient of determination (R-squared).
In terms of results, we backtested the strategy from 2009 until 2024-01-16, and the strategy, as already demonstrated in the book, it manages to have a good risk-return ratio. But, at this time, a Buy and Hold strategy on the SP500 index obtains a much higher return causing potential investors to refuse to invest compared to other published strategies.

With a compound annual return of 8.79% and a maximum drawdown of 24.1%, we would like to highlight the success rate of 59% with a 0.14% return, compared to the loss rate of 41% with the same return in negative. The stock selection method used confirms that the momentum factor works, and although the profitability is not good, it can be trusted that it is a convex selection method with positive mathematical expectation.

Felix Bertran has studied the strategy in depth he exposes its weak points, suggesting aspects of improvement that can lead the strategy to almost double its profitability maintaining the current maximum risk level. The improvements are basically not based on a parameter optimization but they are fundamentally based on improving the money management, the stock universe and the market regime filter for determining risk-off scenarios.
Following his instructions, we have implemented an improved version of the strategy and operate it in real time. In our X (former Twitter) account we publish the week-by-week trades of the new strategy as well as the verified track record and performance.
In the following posts, we will explain what the enhancements we included are by measuring the impact on the key statistics. We hope other community members can take profit of the original code of “Stocks on the Move” book and they can test other improvements for having a best-class stocks momentum strategy where to invest.
CabedoVestment
What is the best day for trading?
The original strategy described in the book suggest to trade on Wednesday. In chapter 14, the author performs a strategy analysis by highlighting the importance of the difference factors with its parameters, buy he does not compare the impact in the results that selecting a different trading day could have. In fact, when he explains the overall rules he mentions:
“We just don’t trade unless it’s a Wednesday. Why Wednesday of all days? Because Wednesdays happen to have a 20% probability of being the best possible weekday to trade. Yes, it’s absolutely arbitrary. Pick a day. It doesn’t matter.”
We wanted to test the differences between trading at the different days of the week to corroborate the author’s statement. So, we have backtested the strategy by only changing the day of the week in the schedule when the strategy rules are run in the Initialize() method:
//Trade only on Wednesday at opening after 1 minutes
Schedule.On(DateRules.Every(DayOfWeek.Wednesday), TimeRules.AfterMarketOpen("SPY", 1),
ScheduledOnWednesday1MinuteAfterMarketOpen);
Coincidentally, yesterday, Tom Mclellan retweeted an article posted by Helene Meisler on Wednesday options put/call ratio behavior, indicating that on Wednesdays is when more puts are added.
https://x.com/McClellanOsc/status/1748373490091384965?s=20
In the table below you can find the different key statistics of the five backtests run from 2009 until the day before yesterday.
You can draw your own conclusions…
We can find huge differences between trading on Tuesday than trading on the rest of the days. Trading on Monday returned the best results, followed by Thursday and Friday with similar results. You can see results on Wednesday are not good.
In general terms, we can conclude that trading on Monday or Thursday would not matter as the author stated, but trading the other days of the week entails getting lower results.
The material on this website is provided for informational purposes only and does not constitute an offer to sell, a solicitation to buy, or a recommendation or endorsement for any security or strategy, nor does it constitute an offer to provide investment advisory services by QuantConnect. In addition, the material offers no opinion with respect to the suitability of any security or specific investment. QuantConnect makes no guarantees as to the accuracy or completeness of the views expressed in the website. The views are subject to change, and may have become unreliable for various reasons, including changes in market conditions or economic circumstances. All investments involve risk, including loss of principal. You should consult with an investment professional before making any investment decisions.
CabedoVestment
What are the strategy parameters that truly make a difference in performance?
In Chapter 14, "Strategy Analysis," of the book "Stocks on the Move," the author demonstrates performance results and drawdowns by conducting different backtests of the strategy over the same period, from 1994 to 2015. Each backtest aims to assess the impact of each rule, component, or parameter that defines the investment strategy.
The author emphasizes the robustness of the model over time, regardless of market conditions. The importance of understanding and potentially modifying certain rules is highlighted, aiming for a strategy that goes beyond rigid sets of rules. Throughout the analysis, the author highlights the importance of understanding the underlying concepts of the strategy and avoiding over-optimization.
The following components are discussed:
Trend Filter: He explores the significance of a trend filter in the strategy. It acknowledges that, while the filter may seem inconvenient at times, it adds value by preventing substantial losses during bear markets. The importance of a long-term trend filter is stressed for navigating through market downturns effectively.
Risk Parity Sizing: He advocates for using risk parity sizing instead of market cap weighting as a way to outperform the index. By measuring past volatility and assigning position weights inversely proportional to that, the strategy aims to ensure that each stock has an equal theoretical impact on the portfolio.
Momentum Period: The discussion touches upon the choice of a 90-day momentum ranking period, stating that it's a reasonable choice for medium-term momentum. The author discourages extensive optimizations and emphasizes the importance of trading based on concepts rather than exact numbers.
Ranking Methodology: The 90 days annualized exponential regression multiplied by the coefficient of determination is compared against two simple ranking method called Pure Percent, and Pure Regression.
Pure Percent measures how many percent a stock made or lost in the past 90 trading days and make ranking tables based on that.
Pure Regression uses just the annualized regression slope based on 90 trading days without the multiplier coefficient of determination.
Position Size: The author suggests that maintaining a balance in position size is crucial for effective risk management. Simulations show that varying position sizes may affect the number of stocks in the portfolio but might not significantly impact overall performance.
Choice of Index: The choice of the S&P 500 index is for being the leader index and the benchmark for comparing almost all stocks strategies. Small to medium sized stocks can show an even greater momentum potential but they may also show more volatile returns. The author do not show results for other indexes.
Observing the different results for each component and the varying values for the parameters, we see that the component that can have a significant impact on improving profitability is position size. Assuming that each portfolio position can have an impact on the total portfolio of 0.5%, the backtest yields a return of 16.3%, 4% annually on average more than with a factor of 0.1%. This is a very significant improvement. The consequence of increasing the risk factor to 0.5 is that the strategy concentrates positions much more in fewer stocks, reducing the number from approximately 20-25 to between 3 and 6. Naturally, this reduces stock diversification and increases the risk of impact in case the selected stocks perform poorly, leading to higher drawdowns during challenging times.
We have conducted our own backtest on QuantConnect to compare with the backtest presented in the first post and verify if the observed improvement in profitability in the book's backtest has remained valid to the current date. The table below shows the results of the backtest, choosing Thursday as the day for executing operations.
The annual return has improved from 8.9% to 11.1%, catrariay the drawdown got worse from 30% to 45.2%. While the increase in drawdown may seem very significant, there is a ray of hope as other statistics improve, such as the WinRate increasing from 60% to 62%, and Sharpe improving from 0.4 to 0.44.
Considering that the increase in the risk factor leads to a higher concentration of stocks in the portfolio, we believe that the increase in drawdown can be mitigated by selecting less volatile stocks. Larger capitalization companies generally have lower volatility than smaller ones, even if all belong to the SP500 index. Therefore, there is a high probability of achieving better results by switching to the SP100 index, where the top 100 companies by market capitalization in the SP500 are included. Below, you can see the results of running the backtest with the SP100 index.
As you can observe, the annual return improves from 11.1% to 12.7%, but the most significant improvement is the reduction of drawdown from 45.2% to 24.3%, a much more acceptable level for a sound stock investment strategy.
In conclusion, compared to the original strategy presented in the book, we see that with simple enhancements such as choosing a different day than Wednesday and concentrating the portfolio more on less volatile stocks, it is possible to significantly increase profitability to match or even surpass the return of the SP500 index with less and more controlled risk.
Additionally, having a portfolio with lower stocks allow investor to manage the strate manually instead of having to automate the trades. This strategy version helps to mitigate the impact of trading fees in performance results, allowing small capital investors to be able to trade with it.
The material on this website is provided for informational purposes only and does not constitute an offer to sell, a solicitation to buy, or a recommendation or endorsement for any security or strategy, nor does it constitute an offer to provide investment advisory services by QuantConnect. In addition, the material offers no opinion with respect to the suitability of any security or specific investment. QuantConnect makes no guarantees as to the accuracy or completeness of the views expressed in the website. The views are subject to change, and may have become unreliable for various reasons, including changes in market conditions or economic circumstances. All investments involve risk, including loss of principal. You should consult with an investment professional before making any investment decisions.
CabedoVestment
Enhancing Loss Aversion Psychology and Maintaining Profitability
We continue with our series of posts introducing a new improvement with a dual purpose. Firstly, it maintains profitability, and secondly, and most importantly, it increases psychological safety in the investment system.
This improvement is inspired by Michael Gayed's famous white paper titled "Leverage for the Long Run - A Systematic Approach to Managing Risk and Magnifying Returns in Stocks" (https://papers.ssrn.com/sol3/papers.cfm?abstract_id=2741701).
In this paper, Mr. Gayed describes how a simple system of leveraged ETFs can be very profitable in the long run by applying a market regime filter based on moving averages.
One of the most striking pieces of evidence from his study is the similarity of results in terms of performance and drawdown regardless of the selected period for the simple moving average. As can be seen in the image below, his study is from 1928 to 2020, more than 90 years! A 10-day period even outperforms the classic 200-day moving average, which is widely accepted as the market regime indicator. So much so that in the book "Stocks on the Move," Mr. Clenow uses it as the indicator for his system.
Precisely, Michael Gayed develops the strategy described in the paper also with the 200-day period, as it is the strategy that trades the least over time. In our opinion, using a strategy with a shorter period and similar results provides value that is not quantitative but is essential for maintaining confidence and peace of mind in the investment system during periods when market downturns begin and doubts or fears arise about whether markets are entering a more severe recessionary period.
Below are the results of modifying the market regime filter component on our system with the improvements already incorporated in previous posts. Specifically, the modifications involve changing the period of the simple moving average from 200 days to 10 days to indicate a RISK OFF period, and also preventing new stock purchases during the stock rebalancing process during these RISK OFF periods.
Market Regime filter = 10 days and avoiding buy when RISK OFF during Rebalance
Market Regime filter = 200 days
As can be seen, the statistics are practically the same. But, imagine being invested during the crises of 2000, 2008, or 2020. Those of you who have experienced a crisis of this magnitude in which the S&P 500 has declined by between 30% and 50% will agree with me that it is not the same to start reducing risk in investments when the S&P 500 has crossed below its 10-session moving average as it is to do so with the 200-session moving average when the S&P 500 has already declined by around 15-20%.
The material on this website is provided for informational purposes only and does not constitute an offer to sell, a solicitation to buy, or a recommendation or endorsement for any security or strategy, nor does it constitute an offer to provide investment advisory services by QuantConnect. In addition, the material offers no opinion with respect to the suitability of any security or specific investment. QuantConnect makes no guarantees as to the accuracy or completeness of the views expressed in the website. The views are subject to change, and may have become unreliable for various reasons, including changes in market conditions or economic circumstances. All investments involve risk, including loss of principal. You should consult with an investment professional before making any investment decisions.
CabedoVestment
Investing in Bonds with idle capital and specially during RISK OFF Periods
Last post where we continue discussing the ways of improvement the system without over optimizing the intial parameters.
In the original momentum strategy described in "Stocks on the Move", during RISK OFF periods, the system does not invest in any financial instruments, keeping the capital in cash. This approach is prudent as it protects the capital from significant market downturns. However, this strategy can be improved by using tactical asset allocation techniques to increase profitability without significantly increasing risk.
In the last post we described: a RISK OFF period is defined when the S&P 500 falls below its 10-day moving average. During these periods, the system progressively sells stock positions as they lose momentum and holds the capital in cash. This has the advantage of avoiding large losses during bear markets, but it also means that the capital does not generate any return, representing a missed opportunity.
To improve profitability during RISK OFF periods, we propose investing the capital in bonds, provided the bond trend is positive. This approach is common in tactical asset allocation systems and can be effectively applied to this momentum strategy. The logic behind this improvement is that bonds tend to have positive returns during periods of uncertainty in the stock market as investors seek safer assets.
The benefits of adding this improvement are:
- Higher Profitability: By investing in bonds during RISK OFF periods, the capital continues to generate returns instead of remaining idle.
- Diversification: Adding bonds to the portfolio improves diversification and reduces correlation with the stock market.
- Risk Reduction: Bonds generally have lower volatility than stocks, providing greater portfolio stability during periods of uncertainty in the stock market.
To evaluate the impact of this improvement, a backtest of the strategy was conducted from 2009 to the present. Below are the results:
As shown, the improved strategy not only increases the compound annual return in approximately 1% but also increase Sortino and Sharpe ratio, providing a better risk-return profile.
The material on this website is provided for informational purposes only and does not constitute an offer to sell, a solicitation to buy, or a recommendation or endorsement for any security or strategy, nor does it constitute an offer to provide investment advisory services by QuantConnect. In addition, the material offers no opinion with respect to the suitability of any security or specific investment. QuantConnect makes no guarantees as to the accuracy or completeness of the views expressed in the website. The views are subject to change, and may have become unreliable for various reasons, including changes in market conditions or economic circumstances. All investments involve risk, including loss of principal. You should consult with an investment professional before making any investment decisions.
CabedoVestment
Extending the "Stocks on the Move" Backtest since 1998 (~27 years)
With the goal of demonstrating the reliability and consistency of the investment system, we have made a change in the selection of the stock universe to obtain the longest possible historical data available through QuantConnect. Instead of using the stocks included in the ETF that tracks the S&P 100 index, "OEF," we have modified the QC500UniverseSelectionModel class provided by the platform to select the 500 largest-cap stocks. We then created a new class, QC100UniverseSelectionModel, which selects the top 100 largest-cap stocks.
Additionally, regarding the improvements introduced in previous posts, we have restored the market regime filter condition to use the 200-session simple moving average (SMA) of the S&P 500.
The backtest results indicate that the "Stocks on the Move" strategy has positive performance, with a Compounded Annual Growth Rate (CAGR) of 14.81% versus SP500 with CAGR of 8.86% (including dividends). While the maximum drawdown is significant at 27.3%, the win rate of 59% and a profit-loss ratio above 1 suggest that the strategy is profitable overall. Additionally, the strategy has a low beta (0.516), indicating it is less volatile than the market in general.
Some areas for improvement might be the Sharpe ratio which is below optimal levels. However, the Sortino ratio is solid, indicating the strategy does a good job of managing downside risk. The low portfolio turnover and total fees suggest the strategy is relatively efficient in terms of transaction costs.
Overall, the results are promising, and the strategy shows good potential for generating risk-adjusted returns moving forward, especially if the drawdown is controlled and transaction costs are optimized.
Here is the system's performance compared to the S&P 500 during the highlighted periods in the results analysis report generated by QC.
The material on this website is provided for informational purposes only and does not constitute an offer to sell, a solicitation to buy, or a recommendation or endorsement for any security or strategy, nor does it constitute an offer to provide investment advisory services by QuantConnect. In addition, the material offers no opinion with respect to the suitability of any security or specific investment. QuantConnect makes no guarantees as to the accuracy or completeness of the views expressed in the website. The views are subject to change, and may have become unreliable for various reasons, including changes in market conditions or economic circumstances. All investments involve risk, including loss of principal. You should consult with an investment professional before making any investment decisions.
To unlock posting to the community forums please complete at least 30% of Boot Camp.
You can continue your Boot Camp training progress from the terminal. We hope to see you in the community soon!