Skip to content

Momentum Trading Strategies Course

October 29, 2020

This post contains affiliate links. An affiliate link means CSSA may receive compensation if you make a purchase through the link, without any extra cost to you. CSSA strives to promote only products and services which provide value to my business and those which I believe could help you, the reader.

One of the biggest barriers to creating a quantitative strategy is knowing how to code. The other barrier is having sufficient theoretical and empirical knowledge. Getting a degree in finance can help with the latter, and a computer science degree can help with the former but if you want to be able to do both you often have to start from scratch which can be very intimidating. I recently took the Momentum Trading Strategies Course by Quantra which is unique because it teaches you both the background theory and empirical research as well as how to code examples in Python– currently the most popular language for algorithmic traders. Given that my coding skills are limited to using Microsoft Excel, this course was especially useful and I even learned a few new things on the research side. Readers interested in enrolling in the course can follow this link and receive an additional 5% off by using the coupon code: CSSA5

Note: This course is currently priced at $179 but will return to its normal price of $499 on November 2.

Before getting to my review of the course below it is important for readers to know a little bit more about the service and the players behind the scences:

Quantra is a learning platform for algorithmic trading courses, where through advanced interactive & hands-on learning technology offers content curated by some of the top thought leaders in the domain of algorithmic trading including;

1) Dr Ernest P. Chan

2) Laurent Bernut

3) Dr Terry Benzschawel

4) National Stock Exchange (World’s Biggest Derivatives Exchange)

5) Multi Commodity Exchange (India’s Leading Commodity Exchange)

6) Interactive Brokers

7) Forex Capital Markets (FXCM)

The parent company of Quantra is  QuantInsti, which was founded by one of India’s biggest HFT firms; iRage, is today one of the world’s most prominent algorithmic & quantitative trading & research institutes with a user base in 180+ countries.

Review On Momentum Trading Strategies Course

First I have to say that this is a really comprehensive course with very slick technology for the e-learning community. The course took me a couple days to complete which was longer than I expected but it also went into far greater depth than I expected as well. To get the most out of the course you should also read the recommended research articles and also work on coding the examples.

It starts off very basic- almost too basic for those familiar with momentum- but gradually builds and gets more advanced with each segment. The topics covered early on include answering what momentum is and why it exists as an anomaly. By the time you get to the fifth section you are being introduced to Python and how to work with commands and loading in data for analysis. You then cover more advanced topics like how to use the Hurst Exponent to cross-sectional arbitrage strategies in futures that exploit roll returns.

In this comprehensive curriculum it seems like every major popular paper on momentum is neatly summarized and the course also covers important topics like Momentum Crashes and risk management. Each segment has examples linked to using Python. There are also multiple choice questions that are there to test your memory and comprehension of the material. As you reach the end of the course you are introduced to even more practical topics like how to automate trading strategies and link to broker APIs.

Overall I was very impressed and I think this is exactly the kind of e-learning alternative that both students and traders/investors need to make their dreams of having their own automated strategy a reality. In subsequent posts I plan to continue to share my learning journey by trying new courses and will provide readers again with a review. Hats off to the team at QuantInsti for being an innovator in this space.

Adaptive VIX Moving Average with Ehlers Alpha Formula

December 4, 2019

In the last post I described a relatively simply method to incorporate the VIX into the well-known AMA or Adaptive Moving Average framework. The alpha formula requires two separate parameters- a short and a long-term constant which requires greater specification by the user. Ideally the fewer parameters you have to specify the better (although it is important to note that logical requirements for maximum lag and minimum responsiveness often tends to dicate the bounds).

Ehlers suggests in his paper on the “Fractal Adaptive Moving Average” using the following formula to compute the alpha in the exponential average:

alpha= exp(- 4.6*(D -1))

where D is analogous to the “VI” or trend factor in the previous post. Note that this formula was adapted in a different way for creating an adaptive volatility measure in this post. I find it to be quite useful and intuitive so it represents a viable alternative to the AMA framework in the last post.

Based on reader feedback I will simplify the percentrank function to be a rolling lookback of 2000 days to make it easier to avoid confusion in replication (the previous used an anchored lookback or “expanding time window”). We can substitute the percentrank of 1/(10-day sma of VIX) for “D” in the formula and calculate the EMA/Exponential moving average of SPY using the alpha output. Here is what the adaptive alpha should look like going back to 1996:

Note that a higher alpha means a faster moving average (less smoothing and lag) while a lower alpha means a slower moving average (more smoothing and lag). We can see in the above chart that the alpha is higher most of the time in bull markets and lower in bear markets (with the 90’s being an exception). No doubt there is a relationship between the VIX and mean-reversion which tended to work well on SPY in periods when the alpha was low. My research in fact shows that profitability was 4x higher buying on down days when this alpha measure was low versus high. What this implies is that you are smoothing more when price is noisy or mean-reverting and smoothing less when price is a decent estimate of tomorrow’s price. Obviously this is exactly what we are looking for when creating an adaptive filter.

Let’s now take a look at how this new transition calculation performs in the adaptive moving average framework. Once again we will compare the strategy of buying when the close of SPY is > 200sma versus the AMA> 200sma.

Consistent with the previous post the AMA strategy is superior to the basic 200sma strategy with fewer trades. The Ehlers alpha method in this case leads to very similar results as using the classic AMA framework for calculating alpha but with even fewer trades. Note that a “D” of 4 vs 4.6 produced a near identical match to the performance and number of trades as the classic AMA framework. In either case I hope this shows the robustness of using the VIX (or you could use historical volatility or GARCH) in an adaptive moving average as a substitute for using the price. In my opinion it is logical to use an adaptive method for smoothing rather than using static smoothing methods or worse yet the actual price in a trend-following strategy.

Adaptive VIX Moving Average

November 26, 2019

One of the challenges with technical or quantitative analysis is to identify strategies that can adapt to different market regimes. The most obvious is a change in the forecast or implied volatility as proxied by the VIX. During more volatile periods we would expect more signal noise and during less volatile periods we would expect less signal noise. But how do we capture this in a strategy? One method is to use the VIX to standardize returns as presented on this blog used “VIX-Adjusted Momentum” in this post. An excellent recent follow-up analysis was done by Justin Czyszczewski which showed that VIX-adjusted trend-following has been recently very successful during these fast moving markets (Tip: using the median or average of O,H,L,C of VIX versus closing data will make the edge of the original strategy more consistent across history). I will show a new variation using this framework very soon in a follow-up post.

Another way to tackle this issue is to vary the lookback length as a function of the VIX. So how would we do that? Enter the basic adaptive moving average framework which seeks to vary the speed or lookback of the moving average as a function of some volatility or trend-strength function.

We can easily substitute the VIX within the “VI” by looking at a standardized measure of how high or low volatility has been relative to past history. If it is higher we want to smooth more or have a longer lookback, and if it is lower we want to have a shorter lookback. This can be accomplished as follows:

Basically we are taking the percentile ranking using all history to date of 1 divided by the current average VIX over the past 10-days. To visualize how this moving average works we can see it applied to the S&P500 (SPY) in the chart below:

Notice that the moving average tracks the price very closely during bull markets and then filters out noise by becoming smoother during corrections. This is exactly what we want to see! Now lets compare a standard 200-day sma strategy that uses the current price versus using the Adaptive VIX Moving Average filter.

The result is a nice boost in gross performance (no transaction costs) that also happens to come with far fewer trades (48 vs 164) which would even further boost net performance. The results are in the table below:

This concept can be extended in several ways including using a simple moving average on the AMA line to create faster crossover strategies that are more responsive to market conditions. Ultimately this is a very simple and intuitive way to adjust standard trend-following as a function of changing volatility regimes.

Which Quant ETFs are Outperforming?

November 18, 2019

One of the challenges of investing in today’s environment is that there are so many investment products that it is hard to keep track. Our recently launched site Investor IQ is designed to help better organize investors and provide them with the analytics required to make better decisions. The biggest risk to chasing performance is if you aren’t on top of what is happening now and instead are chasing the last 3-year or 5-year winning fund (which are likely to mean-revert). Our relative strength rating tracks momentum at shorter intervals in order to better capture future outperformance. Here is a current snapshot of our “Quant ETFs” category under US ETF Digest which makes it easy to see which quant styles are outperforming right now:

As you can see the market is currently favoring stocks that are either undervalued (Value Screen/QVAL and Shareholder Yield/SYD) or exhibit growth at a reasonable price (GARP) which are ranked at the top by relative strength or “RS Score”. This reflects a significant shift away from growth (FFTY) and momentum (QMOM) which are ranked in last place. In fact the signal- which an ensemble of trend and momentum signals- shows that their trends are in a caution or “Hold” position while all other factors remain in a “Buy” signal. The OB/OS oscillator in the far right column is an ensemble of mean-reversion indicators that ranges from 0 to 100 (least to most overbought). Currently all of the ETFs in the list are neutral in terms of timing but nearing overbought territory (>80) where new purchases should either be avoided or existing positions should be trimmed.

The goal of this list was to capture many of the factors that quants use to produce alpha versus the broad index in a long-only format. We deliberately omitted strategies that had the ability to raise cash since I would consider that a separate genre of tactical strategies. If you have suggestions for additional quant ETFs that are not redundant to the members of this current list feel free to leave them in the comments section and I will seek to add them over time pending review.

Investor IQ Website is Live (In Beta)

November 11, 2019

For readers interested in getting signals and analytics on hundreds of ETFs and individual stocks our Investor IQ website is currently live and free during our beta-testing phase. We will be adding new data and analytics gradually over time as well as improving website functionality. The Economic Model is currently hosted on the site and predictions are updated every 2-3 days in real-time. Subscribers will soon receive access to backtests on the economic model (I have received plenty of requests) and other research unique to the website. For the time being we will continue to publish Investor IQ on this blog with limited functionality on a weekly basis for our readers so be sure to sign up to the website as soon as you can!

Current Economic Model Prediction

October 29, 2019

As of the 25th of October the Economic Model changed signal from sideways to bullish. So far the out of sample predictions since its creation have been quite useful for trading during these tricky markets. While Fed day is tomorrow and could change market sentiment, the economic numbers continue to show that we are not nearing recession territory. This prediction is in contrast to many pessimistic news articles that have been published over the last two months. Ultimately news articles focus on very recent data and tend to isolate a few specific indicators that may no longer have much predictive value (or are context dependent). That was the reason for developing an integrated model that uses 50 different indicators along with dozens of derivatives of the same time series within a decision-tree framework. This model will be featured in real-time on our upcoming website.

Mean-Reversion in Trend-Following Performance Using a 120-day Lookback

September 19, 2019

In the last post we showed that trend-following tends to be mean-reverting in the short-term. Data analysis also shows that trend-following has an even stronger mean-reverting effect using a 6-month or 120-day window using the same methodology. Take a look at the chart below using the BarclayHedge SG Trend Index:

In the last post I hypothesized that the mean-reversion effect exists because investors tend to chase recent performance. But there is obviously a lot more going on that drives the performance of trend-followers including lower interest rates, higher correlations, and generally less pronounced trends. Certainly monetary policy worldwide has also played a factor. A very good paper by Spring Valley analyzes some of the factors that have affected trend-following performance. Ultimately the data suggests that you need to incorporate this effect into your strategy or asset allocation methodology in order to be more consistently profitable using a trend-following approach.

Mean-Reversion in Trend-Following Performance

September 18, 2019

In a recent post I showed that the momentum factor has been mean-reverting in the short-term, and that this effect can be used to trade both the factor and momentum strategies effectively. An obvious extension is to see whether trend-following as a factor is also mean-reverting. After all, time-series momentum and momentum have been shown to be related in the research.

To represent the trend-following factor I used the data for the BarclayHedge SG Trend-Following Index which captures the profitability of CTAs that follow a systematic trend-following approach. For consistency, I used the same methodology as the original post: I took the 10-day return and smoothed using a 5-period simple moving average in order to reduce noise. I then took the percentile ranking using all history available at each point-in-time of that smoothed return. Oversold was considered to be when the percentile ranking of the return was below the median (<.5) and overbought was when the percentile ranking was above the median (>.5). Positions are held until the percentile ranking goes back above (below) the median. As a third strategy, I tested avoiding the top quartile of performance (<.75) which is a lower turnover and perhaps a more realistic strategy.

In general we see evidence of mean-reversion in trend-following performance (this is true using a wide variety of parameters) which becomes most pronounced starting in early 2014. The strategy of avoiding the top quartile (long when trend-following has not recently been performing very well) has been effective over longer periods of time.

The lesson highlighted in recent posts has been that to be effective in the modern day environment you have to be a contrarian— buying momentum and trend-following strategies after they have had poor performance. The reason this anomaly likely exists is because people tend to hire and fire managers based on recent performance. As a piece of anectdotal evidence: when I was doing consulting work a long time ago, I used to joke with my colleagues that certain clients were particularly adept at timing when to be in or out of strategies: as soon as they were upset, the strategy probably bottomed, and as soon as they wanted to increase their allocation it had probably topped. After making several poor allocation/timing decisions they usually quit the strategy altogether claiming that it was ineffective.

I made a presentation at a conference in 2010 about mean-reversion in strategy performance using a sample of over a hundred different strategies (including both mean-reversion and trend-following as well as many others). My experience in money management after 2010 has been no different. Unfortunately, all marketing is geared toward recent performance so there is a conflict of interest: if you understand that strategies mean-revert in the short-term then you will be marketing most when clients are least likely to make money. AUM flows tend to reflect that this method works well. It is therefore not surprising that DALBAR studies show that the average investor (most of whom have advisors) significantly underperform their risk benchmarks.

Mo Data: Using Mean-Reversion in the Momentum Factor to Time Momentum

September 12, 2019

In the last post we used the data available for the momentum factor using an ETF (ticker: MOM) which seeks to replicate The Dow Jones Thematic Market Neutral Momentum Index to time when to be in or out of high momentum stocks. Alpha Architect recently did some interesting analysis of the distribution of returns for the same momentum index in this post. One of the challenges was the lack of data available for testing. Ideally we would have much more data. To address this issue I found that the Kenneth French Data Library has daily momentum factor returns. To find a tradeable long-only momentum strategy, I used PDP which is the Invesco DWA Momentum ETF and is based on the Dorsey Wright® Technical Leaders Index (DWA Technical Leaders Index). The strategy is to go long PDP when the momentum factor is oversold (<.5) and this is compared to a strategy that goes long PDP when the momentum factor is overbought (>.5). For more details please read the previous post. The results are in the chart below:

Having data prior to 2013 is valuable because we get to see how the strategy performed during the credit crisis in 2008 and also in the beginning of the explosive bull rally from 2009 to early 2010. Clearly mean-reversion in the momentum factor has worked well in timing high momentum stocks since 2007. While not shown, I tested a wide variety of different parameters and found very similar results. To determine whether this is a pervasive effect across history would require extensive testing with synthetic momentum strategies, however my guess is that this has been effective for at least the last 25 years. Ultimately if it works back to 2007, it is clearly worth using and at least watching as part of your trading in either high momentum stocks or their proxy ETFs or mutual funds. However it is worthwhile doing some additional analysis to determine why this strategy works.

When Should You Buy Momentum? Mean-Reversion in The Momentum Factor

September 12, 2019

Recently there was a good post by Bespoke Research highlighting the “Momentum Massacre” that we recently witnessed in the market. High- flying momentum stocks were decimated and the low momentum/losing stocks made a roaring comeback. One of the best ways to track the momentum factor is to look at the ETF ticker symbol: MOM or QuantShares U.S. Market Neutral Momentum Fund. As you can see in the chart below, the momentum factor has taken the elevator down over the past 10-days completely reversing total returns year to date.

This begs the obvious question: can we expect some mean-reversion in performance going forward? As a simple test I took a look at 10-day returns in MOM and smoothed them using a 5-day average to account for some of the noise in closing prices for less liquid ETFs. Then I took the cumulative percentile ranking looking at all data available at each point-in-time of that smoothed 10-day return. What I found was that in the last 8 years (the maximum data available), the momentum factor has been highly mean-reverting. If you bought the momentum factor after smoothed 10-day returns were above the median (.5) you lost money consistently. In contrast if you bought when returns were below the median you made money consistently. Clearly mean-reversion has been a powerful factor driving performance as you can see in the chart below:

To get a sense of how this would benefit investors that follow high momentum stocks, I looked at how using the same mean-reversion oscillator on MOM could be used to time MTUM or iShares MSCI USA Momentum Factor. In the chart below we see that using this oscillator has been a very useful way to time whether to be in or out of high momentum stocks:

When the momentum factor was oversold (<.5) you made almost 17% annualized with a sharpe of 1.74, and in contrast when the momentum factor was overbought- which was nearly 50% of the time- you lost money. One of the obvious questions is whether there is some bias in the momentum methodology unique to MTUM that makes it less generalizable to a more concentrated approach. To address this concern I tested using the oscillator on QMOM or Alpha Architect’s U.S. Quantitative Momentum ETF. While there is a much shorter history the general conclusion is the same: mean-reversion in the momentum factor is a good way to time momentum stocks:

Finally, and perhaps the most interesting test was whether or not the momentum factor on stocks can be used to time asset class momentum. I have read studies in the past that show that the momentum factor is correlated to asset class momentum. If that is the case then we can expect that the oscillator should be effective in timing global asset allocation. To test this I used GMOM or Cambria’s Global Momentum ETF. The chart tells the story below:

Clearly mean-reversion has been effective for timing global asset allocation that uses a momentum approach. What was surprising was just how effective it was. Having more data using proxy strategies to test these hypotheses over a larger sample size would be valuable, but I currently don’t have access to that data on a daily basis going far back in time. Nevertheless, it is still very important to respect current market trends and how they impact investment strategies. In recent times, the effect of mean-reversion in momentum factor is a very real and material driver of performance.

Why might there be a mean-reversion effect in the momentum factor? I think that a lot of stat arb money chases the momentum factor, and to be able to rebalance in order to maintain risk limits and to unwind positions they need to sell when they are profitable and buy back when they are losing money. To do so requires that a lot of retail and other institutional money be chasing or fleeing from momentum in order to provide them with liquidity. Perhaps this “smart money” effect explains why momentum is mean-reverting. In either case trying to explain why this happens would require a very thoughtful and deep analysis in the form of a serious research paper.