Building a DIY Momentum Screener on Google Sheets

Before you start building a screen you need to understand what factor based trading strategies are and how momentum, which is a subset of factors, has performed over the centuries.

Below is a repository of all the research material I have collected, this is, by no means complete, I keep adding new materials as I chance upon them. This will definitely give you a good idea of the strategy before starting.

https://drive.google.com/drive/folders/17FX9ps3CKAEoU8UgVVey7EsQ4V0hoisj?usp=sharing

Beyond this you should listen to the podcasts on YT by channels like ‘Chat with Traders”, “Top Traders Unplugged” where best of the best who have been doing this for decades share their knowledge of trend following systems.

So moving on to the screener, google sheets is sort of the easy way of doing this. Do note that google sheets will not allow you to do back tests on your strategy. For that you need to know a coding language and obtain clean corporate action adjusted data from the exchanges.

Most of these data feeds are paid, you can build a system where you download the entire historical data from a feed once and then append the data from google sheets everyday.

More creative people can scrape the data from exchange websites for free. If I remember correctly there was a CFA society video by Parijat Garg on this subject.

Back testing is sort of important when you add certain conditions to your strategy, but it is not the holy grail. So you can do without back testing if you have faith in your system.

Here is a sample of what I have built on google sheets. This is just to tell you that if you are decent in excel, you can build it yourself and run your momentum strategy without knowledge of coding.

To give a few pointers,

  1. Define you stock universe – Can be 50/100/200/500 or all stocks.
  2. Get the tickers from NSE website.
  3. Define your lookback period.
  4. Get the price data for each of the stocks in your universe for the above lookback period and current price.
  5. Calculate the % change in price and sort them based on this.

The above is the simplest form of momentum. You can even build a ranking system based on Sharpe, Sortino and various other factors mentioned in the repository above. But it will require some more data in the sheets. Alternatively, you can even find these rankings based on look back period return, Sharpe etc. on websites like askkuber, valueresearch, tikr and many others.

You can also use screener.in to build such a screen, just use the equations below and sort them based on 1 Yr returns in descending order,

Percent from ATH > -25% AND
Market Capitalization > 1000 AND
Return over 1year > 0

Per cent from ATH is a custom ratio I built in the screener. One can build it yourself using the formula,

(current price/high price all time – 1) * 100

Another way to build a momentum screen if you are not familiar with google finance or coding is to just download the bhavcopy from the exchanges for the dates you are interested in. Ex. one will be for today, and another will be sometime in the past, say 6/9/12 months. Just take the close prices between the two dates, calculate the % change and rank in the order of descending returns.

Besides this you will also have to make decisions on your portfolio diversification, weightage, entry/exit strategy, filters, and rebalancing frequency etc. This is how everyone builds a system that they are comfortable believing in and following when momentum crashes happen. You will have to go through the research to build a system that suits your personality.

If you have read till here, obviously you are interested in DIY momentum strategy but just in case someone is completely new to the momentum bandwagon, and you are intimidated by sheets, there are a lot of small case providers who will run the strategy for you for a fee. Most people want to DIY because these small cases are black boxes and their detailed strategy is unknown. They are also relatively new and it is difficult to know how they will perform in a downturn. Lastly, some even find them costly.

Depending on your portfolio diversification, if you want to follow the system perfectly you will need 2-6 lacs capital to start with. This figure is wide, the more you will diversify the more capital you will need. Some periods will require less capital and some more. If you are really constrained on starting capital, you should not be doing this in the first place. If you are still adamant you can remove the most expensive scrips till the portfolio reaches your capital level.

I share my momentum ranking calculations here:

https://abimehrotra.wixsite.com/mysite/research

To conclude with the important question, why momentum strategy? Well, the answer is simple. It provides a good strategy diversification to your portfolio. No strategy works all the time just as no asset class works all the time.

Disclaimers:

  1. Please do not construe this post as an investment advice. This is for educational purpose only.
  2. No investment capital is being solicited from the readers of this post.
  3. Momentum based trend following isn’t the holy grail, panacea of making money. Be aware of it.
  4. Beware of momentum crashes.
Standard

17 thoughts on “Building a DIY Momentum Screener on Google Sheets

  1. Chandan Bhagat says:

    sir please could you please paste here formula for calculating stddeviation ?
    also in your sheet there are two column of std deviation one is std deviation and other
    -ve std dev what is it ?

    Like

  2. Pardhu Nani says:

    First of all many thanks for sharing your research material. Very rare people does that
    All good should happen to you

    Can you please tell me approach to rebalance monthly portifolio. Lets say i buy top 30 ranked stocks then after one month how can i rebalance ?

    Please advise

    Like

    • Pardhu, thank you for your kind words. For rebalancing, you can get a new ranking list for every rebalancing period (this can be weekly, monthly, quarterly etc.) The top 30 ranks don’t change completely all the time. Usually, on average the churn is 20% every month or around 250% every year. So you just sell the stocks which were in your last month’s portfolio but have dropped from the new top 30 ranks. And then buy the new entrants in the new top 30 ranks.

      Liked by 1 person

  3. Pardhu Nani says:

    After i researched about calculation of momentum of stocks. Only change in price is not a better indicator some suggested

    1. ADX
    2. ROC+ EMA

    ?

    Which one are you using to calculate momentum ranking and also which loopback period you prefer?

    Like

  4. Vivek Mallik says:

    Thanks a ton. I was searching for this very data that you freely share. First I copied data from your site and made a list on google sheet. But I wanted to calculate Sortino and Std Dev myself. So, after going through many educational material, I developed my formula to calculate Sortino ratio. I have a sheet with 356 days of data that go into calculating Std Dev and Sortino. Almost all formula, except Sortino, has been copied from your sheet. You are awesome.
    If I may ask you another favour- Can you evaluate my spreadsheet if my Sortino is being calculated the right way? Thanks once again.

    Like

    • Hi Vivek,

      Sortino’s purpose is to penalize a stock only for its down day volatility. The way you need to do this, is to funnel out the -ve days only in a separate sheet using a simple “if” statement.

      Once you have only the down days, just calculate the STDEV on those and calculate the sortino.

      Liked by 1 person

      • Vivek Mallik says:

        Thanks for your prompt reply. Will it be prudent to replace risk-free return with benchmark returns in the Sortino formula?
        Also, Sortino ratio for the same stock (e.g. SBIN) are different in NSE500, NSE200 & NSE100. Can you explain why?
        Thanks and regards, Vivek

        Like

Leave a comment