Testing Different Momentum Rules

In this article I will test a variety of different momentum indicators which can be used to build a long only equity portfolio which has historically outperformed the market.

To begin with, we need a baseline momentum strategy…

Baseline Momentum Strategy

  • Rank stocks in the S&P500 by order of 1 Year Rate of Change %.
  • Buy the top 20 strongest stocks.
  • Exit a position if the stock falls out of the top 50 highest ranked.
  • Positions have an equal cash allocation (5% of portfolio equity).
  • Entries and Exits are made on the open of the 2nd trading day each month.
  • Open positions are rebalanced on the open of the 2nd trading day each month.
  • Only rebalance the weight of an open position if the current weight deviates by more than 20% from the target weight.

I’ve had readers get in touch with me asking to test this type of strategy on data which covers the 1987 market crash. Not wanting to disappoint those readers, the first few tests will include the data between 01/01/1987 and 31/12/15.

The data which I am using is the PDU Alpha Testing data provided by Norgate Premium. This data includes Historical Index Constituents and is adjusted for splits and dividends.

The charting software which I’ll be using for the analysis is provided by Amibroker.

With the above said, I should point out that when using data from the late 1980’s it is very likely that your back-test results are going to be different than the results you would have achieved if trading the market live.

If any readers have access to a different database than what I am using here, I would be most interested to compare results if using the same rules and test period.

The costs which I’ll be simulating are set at $10 per transaction.

Baseline Momentum Strategy Results

  • CAR = 13.46%
  • MaxDD = 63.48%
  • CAR/MaxDD = 0.21
  • Exposure = 99.86%

The monthly breakdown of returns and chart of the portfolio equity are below…




Applying a Market Timing Filter

The above results illustrate that holding a portfolio of momentum stocks has historically outperformed the S&P500 index.

The problem is that during the sample period, there were 2 occasions when the maximum draw-down exceeded 60%.

To help mitigate the impact that a bear market will have on the portfolio, we can apply a market timing filter to the strategy.

The market timing filter will be a simple one. We are only allowed to enter a position if the S&P500 Index is above its own 200 day moving average.

When applying the above market timing filter to the strategy, the momentum strategy produces the following results…

Baseline Momentum Strategy Results (With Market-Timing Filter)

  • CAR = 15.71%
  • MaxDD = 52.84%
  • CAR/MaxDD = 0.30
  • Exposure = 84.79%



The above results illustrate that scaling out of positions when the Index is beneath the 200 day moving average has been a useful method for improving both the absolute and the risk adjusted returns of the strategy.

But is the 200 day moving average filter curve-fit to the historical data?

Instead of using the 200 day MA index filter, I’ll test the strategy using 100 – 300 day moving average look-back periods in 5 day increments . All other rules remain the same.


The above table shows us that the look-back period we use to form the moving average is of less importance than the concept itself.

I.E. The historical performance of the momentum strategy was improved by not entering new positions if the index was weak.

Momentum Strategy with Market Timing (Using 1 – 24 Month % Return Ranking Method)

For the next test I will include the 200 day Index moving average filter, but I will change the period used to calculate the Rate Of Change %.

Instead of using the 12 month return to calculate the strength of a stock, I’ll test the strategy using 1,2,3,…..,24 month returns.

All other rules remain the same.

ROC values

The above table suggests that the most successful ROC% look-back parameters during the test period have been between 2 and 12 months.

Delaying the Entry by One Month

Many academic papers about momentum suggest that it is a good practice to skip the most recent week or month when formulating the ROC%. The given reason for doing so is that during the short-term, stock prices are mean-reverting.

The concept is illustrated on the following chart image…


For the following tests I applied the one month delayed entry to each of the ROC% tests from above. The following chart plots the number of months to formulate the ROC% on the x-axis and the corresponding CAR% and MDD% on the y-axis.

One month Lag

The results of the ROC% ranking method during these particular tests were not improved if delaying the entry by one month.

Different Ranking Methods

The above strategy variations each used the ROC% indicator to rank the stocks in our database, but there are lots of different methods for ranking the strength of a stock, and some of those methods will be tested below.

For the following tests, I’ll reduce the length of the sample period and begin each test on the 01/01/2000.

I’ve chosen the year 2000 because it was a bad year for the strategy and I think it’s important to test how a strategy would have performed if you had been unlucky enough to start trading it during an unfavourable market environment.

To recap, we have a very basic momentum strategy which has the following rules…

  • Rank stocks in the S&P500 by order of 1 Year Rate of Change %.
  • Only initiate new positions if the $SPX is above the 200 day MA.
  • Buy the top 20 strongest stocks.
  • Exit a position if the stock falls out of the top 50 highest ranked.
  • If the $SPX is above the 200 day MA, replace sold positions with new higher ranked stocks.
  • Positions have an equal cash allocation (5% of portfolio equity).
  • Entries and Exits are made on the open of the 2nd trading day each month.
  • Open positions are rebalanced on the open of the 2nd trading day each month.
  • Only rebalance the weight of an open position if the current weight deviates by more than 20% from the target weight.

The strategy performance since 01/01/2000 is as follows…

  • Trades = 491
  • CAR = 8.40%
  • MaxDD = 55.14%
  • CAR/MaxDD = 0.15
  • Exposure = 78.42%


The monthly breakdown of the momentum strategy returns are below….


The above chart and table illustrate that the returns of the momentum strategy are far less attractive if we omit the bull market of the 1990s from the sample period.

However, the strategy still outperforms a simple buy and hold of the index and if you had invested $100,000 in the momentum strategy at the beginning of 2000, you’d have more than doubled the returns of a buy and hold investor.

Next, I’ll test some alternative ranking methods…

Gain to Pain Ratio Ranking Method

The gain to pain ratio was brought to prominence by Jack Schwager in his great book “Hedge-Fund Market Wizards”. 

To calculate the GPR, you take the sum of all positive periods and then divide by the absolute value of the sum of all negative periods.

As with each of the tests in this section, the periods used will be 252 trading days.

GPR Results

  • Trades = 609
  • CAR = 8.82%
  • MaxDD = 34.33%
  • CAR/MaxDD = 0.26
  • Exposure = 78.24%

The monthly breakdown of returns…


Kaufmann Efficiency Ratio Ranking Method

The efficiency ratio was popularized by Perry Kaufman in his book Trading Systems and Methods“. The efficiency ratio measures the strength of a trend and then adjusts for volatility.

The calculation is as follows…

EfficiencyRatio = ABS (Change in price over N-Periods) / Sum of ABS (individual price changes)

The efficiency ratio can be seen plotted in the bottom pane of the next chart…


The problem with the current formula is that it ranks strongly down-trending stocks as highly as strongly up-trending stocks. We should therefore modify the formula to…

EfficiencyRatio =  (Change in price over N-Periods) / Sum of ABS (individual price changes)

The ratio will now have a value between +1 and -1.

If the Ratio is above 1, the trend is up. The modified efficiency ratio is plotted beneath the same price chart as above…


Efficiency Ratio Results

  • Trades = 623
  • CAR = 8.74%
  • MaxDD = 27.48%
  • CAR/MaxDD = 0.32
  • Exposure = 77.97%

The monthly breakdown of returns…


Price to MA % Difference Ranking Method

The price to Moving average % difference is simply the percent difference between the Close price and the X day MA.

Again, for the following test we’ll use 252 days to formulate the MA.

Price to MA % Difference Results

  • Trades = 612
  • CAR = 13.79%
  • MaxDD = 31.68%
  • CAR/MaxDD = 0.44
  • Exposure = 75.74%

The monthly breakdown of returns…


Equity Curves Produced by Each Strategy

It was my intention to plot a matrix to illustrate how correlated the returns of each strategy are to one another (and also to the market), but the following chart is sufficient enough to make the same point…



Improving the Strategies

There are lots of ways that you could improve these strategies, below are a few ideas…

  • Apply a Profit Target to each new position.
  • Only trade stocks that haven’t recently made an excessive move.
  • Use volatility adjusted position-sizing.
  • Use market-breadth timing filters.
  • Use an absolute momentum filter.
  • Trade a different basket of stocks.
  • Change the level of portfolio concentration.
  • Apply a fundamental screen to the strategy.
  • Adjust the parameters used to formulate the ranking method.
  • And so on…

Survivorship Bias

Finally, I wanted to illustrate the importance of having access to a survivorship bias free database.

The following chart plots the equity curve produced by two of the same momentum strategies, but one of the equity curves was produced if applying the rules to only the current S&P500 constituents…



To put it bluntly, testing the above strategies on a database that doesn’t account for survivorship bias will grossly exaggerate the strategies potential.


  • Paul C

    Reply Reply April 11, 2016

    Very interesting testing Llewellyn. Being able to identify stocks that are moving and jumping on board can be a good strategy

    When ranking the top 50, is this done monthly, based on the past 12 months?
    or annually?

    • Llewelyn James

      Reply Reply April 11, 2016

      Hi Paul,

      I used daily data for the tests and to keep it simple I set the ROC% indicator to 252 days. This tells us the prior 252 day (about one-year) % return on any given day.



  • David

    Reply Reply April 11, 2016

    Did your list of S&P500 stocks adjust through the years or did you just test the S&P500 stocks as of today?

    If it adjusted, do you have a copy of that list or how did you go about verifying a stock was included in the S&P on a current date?


    • Llewelyn James

      Reply Reply April 11, 2016

      Hi David,

      As stated in the article, I used the Alpha Premium data provided by NorgatePremium. The data includes historical index constituents.

      “Alpha Testing Disclaimer

      The PDU software is at the Alpha testing stage. It is known to be stable, but changes affecting stability may be introduced at any time. Also, some of the additional data that the platform delivers (e.g. historical dividend information) is still being researched and cross-checked, especially for delisted securities. If any information needs to be revised or supplemented, it is done so without notice. Please be aware of these factors before relying entirely on the platform for trading purposes.”

      To verify that a stock belonged to the S&P500 at the time of the trade, you can use the following line in your Amibroker formula:

      InIndex = IsIndexConstituent(“$SPX”);

      If you wanted to test Russell3000 stocks, you’d use IsIndexConstituent(“$RUA”), and so on.



  • Tim Vidmar

    Reply Reply June 13, 2016

    Hi Llewellyn,

    Excellent article, straightforward, but thorough explanation and testing! Really appreciated.

    A short question: you mention “absolute momentum” as one of the possible. improvements. How do you define it?

    Sincerest thanks,


    • Llewelyn James

      Reply Reply June 13, 2016

      Hi Tim,

      Thanks for reading the article and getting in touch. Regarding your question, “Absolute Momentum” (sometimes referred as time-series momentum) is the measurement of a securities own past return. This is in contrast to “Relative strength” momentum, whereby the past return of a security is measured “relative” to the past return of other securities.

      In the context of this article, we are ranking the stocks relative to one another. So to take a specific example, LNKD has a one year return of (-39.86%) and TWTR has a one year past return of (-60.88%).

      Because the one year past return of LNKD is greater than the one year past return of TWTR, we’d rank LNKD higher than TWTR on a relative strength basis.

      However, both stocks have a negative one year past return so the “Absolute momentum” for both stocks is negative.

      So an “Absolute momentum” filter might be to only buy a stock if the one year past return is greater than the Zero, or some other threshold. This is regardless of how strong the stock might be relative to other stocks.

      Perhaps we’ll only buy a stock if the absolute momentum (its own past return) is greater than the absolute momentum of the S&P500. There are many absolute momentum filters that you might like to test.

      I hope that helps.

      Kind regards,


  • Wilko

    Reply Reply February 20, 2017

    Great write-up! Especially liked the illustration of survivorship bias.

Leave A Response

* Denotes Required Field