Timing the market by spotting bullish and bearish trends

I discuss how to use how to time the market by spotting bullish and bearish trends with the moving average crossover. The idea is well known in technical analysis and involves two moving averages. This is the 7th post in the series on tactical asset allocation (link to all posts). We had earlier considered market Timing With Ten Month Moving Average. So let us start with the basics.

What is a moving average? The goal in market timing strategy is to spot trends. However, if you plot closing prices of an index it will not be smooth, making it hard to find trends. So we take the average of the previous 7 days, 30 days, 365 days 12 months, 10 months every day. This smoothens the trend and easier to work with. Since the average is taken each day it is moving and is similar to a rolling return.

What is moving average crossover?

If we use a single average like the ten-month average, we look for when the price goes above or below the average. Instead, we can use two moving averages. There are many dual moving average strategies. In this post, I shall consider what Jim Otar calls as a hurricane warning chart in his book, “Unveiling the Retirement Myth”.

Long-term readers may recall that I had introduced a tool for it – Moving Average Market Level Indicator and enhanced it with additional features and for all Nifty indices: Nifty Valuation Analysis with PE, PB, Div Yield, ROE, EPS of 21 NSE Indices. So this is how it works. Plot the 5-month and 12-month daily moving average. I have used the automated tool to plot the 150 day and 364-day averages

moving average crossover method chart one

A bearish trend is possible when the 150-day average falls below the 364-day average- downward arrows. A bullish trend is possible when the 150-day average moves above the 364-day average – upward red arrows. Notice that the red line has not yet crossed below the blue line.

Naturally, like any method, this also suffers from problems. When the market zooms up nicely and then down nicely, it is easy to spot trends (with any method). However, during a sideways market, the averages will cross each often. This is known as whipsaw in trading. See the picture below for example.

moving average crossover method chart two

This means frequently buying and selling (see rules below). While the use of long-term averages minimises the whipsaw, it cannot be eliminated. However, for the period that you see in the first picture above, this has not been much of a problem (it can be in future). Before we see the rules, an important message.

Warning and Disclaimer

The following is to be treated as investment research based on past data unrepresentative of practical implementation and is not investment advice. They do not factor in behavioural/emotional aspects associated with investing. If you do not know how to understand a backtest result, evaluate its disadvantages, then please, please DO NOT play with your money using market timing. Please watch this video before proceeding further.

What is meant by tactical asset allocation (TAA)?

Asset allocation is the ratio of much equity, fixed income, gold, cash etc. is present in a portfolio. We will only consider equity and fixed income in this study. Tactical asset allocation (TAA) refers to changing these allocations based on certain factors or indicators

What is market timing?

It is a technique to reduce portfolio risk and/or enhance portfolio returns by changing asset allocation based on our reading of where the market will head in the near future. This can be the stock market, bond market, gold market etc.

Is tactical asset allocation necessary?

Yes, as the risk associated with a portfolio must be systematically reduced or contained to ensure we have enough money for our future needs.

Is market timing necessary?

No. Tactical asset allocation is necessary and one need not resort to market timing to do this. TAA is possible based on a target corpus associated with a financial goal. See:

Part 1 How to reduce risk in an investment portfolio

Part 2 Do we need to time the market?

Part 3 Why we need to gradually pull out of equity investments well before we need the money!

Can we time the market?

Yes. However, realistic and reproducible market timing methods have often primarily reduced risk with or without return enhancement. See results here: Want to time the market with Nifty PE? Learn from Franklin Dynamic PE Fund and here: Is it possible to time the market?

Rules of moving average crossover market timing

1: When the 150-day average is above the 365-day average, invest systematically in equity and debt. We use Nifty 50 to represent equity and an imaginary debt instrument that gives a steady 8% a year return.

2: When the 150-day average fall below the 365-day average, exit all equity. Stop investing in equity. Move all holding to debt and invest the full monthly amount in debt.

3: When the 150-day average mover above the 365-day average., move back into equity. Only the portion that was earlier shifted to debt is moved back into equity. The systematic investment in debt continues at all times and is untouched. Let us consider an example.

In Jan 2016, the 150-day average fell below the 365-day average. The equity portfolio was worth Rs. 60,000 and debt Rs. 40,000. We sell the 60K equity holdings and moves to debt. Then we invest only in debt. Suppose the total monthly investment was Rs. 1000 and out of this Rs. 600 was supposed to be invested in equity. Now, this Rs. 600 per month is also invested in debt as long as the 150-day average is below the 365-day average.

After 12 months, the 150-day average moved above the 365-day average. Then we do three things (1) start investing Rs. 600 a month in equity and Rs. 400 in debt. (2) Recall that we have moved Rs. 60K to debt. We find out its current value, say Rs. 65K and shift it back to equity. (3) We have been investing Rs. 600 in debt for 12 months. That total amount is now worth Rs. 8000. This also is moved back into equity. If you think in terms of mutual fund units, this is a matter of simple accounting. If it is too hard for you, don’t choose this! Don’t blame the method for your mental blocks.

In this post, I have backtested this strategy for a single 18.7 year period from 2000 onwards. I will backtest this for more periods next time. The excel file had to re-written for this strategy and it is tricky to include multiple backtesting here. The tactical strategy mentioned above is compared with a systematic investment of Rs. 600 in equity and Rs. 400 in debt each month. The systematic portfolio is not rebalanced.

Amusingly and quite surprisingly in the 18Y period, one had to exit out of equity only eight times! This also means eight times moving out of debt and re-entry into equity. This will mean exit loads and tax and this has not been accounted for in this study. If one were to rebalance the systematic portfolio (as one should!), it would mean 18 exits from equity/debt!

A disclaimer before you view the result. Only one 18Y window has been tested. Taxes and load have been ignored. If include taxes/loads and test over multiple periods, the moving average crossover method is unlikely to work all the time like any other method. I will publish this study in the next few days.

Never forget that market timing is a risk reduction technique and not a return enhancement technique. It does not matter if the final return of the timing portfolio is lower than the systematic portfolio as long as timing reduces risk. I find many new investors do not seem to appreciate this. Always, always remember risk is real-time and return is in hindsight. Market timing strategies are for reducing the real-time risk. We do not know how much return they will provide in the future. Only sales people or investors brainwashed by salespeople will claim systematic investing is the best. Nothing is the best. It is only a question of what method is suited to an investors temperament

Moving average crossover 18-year study

Moving average crossover 18 year study

The maximum loss or drawdown is lowered by more than 50% using the moving average crossover and this is fantastic. It is only incidental that for this window the tactical portfolio (next XIRR 12.5%) has done better than the systematic portfolio (11.5%). Notice the regions marked by the arrows. They are smooth because, during the bear market or crash, the portfolio has no equity.

In the present backtest, the equity in the portfolio swings from 60% to 0% and there is a minimum of 40% debt at all times for safety. There are of course other ways to run the backtest. We will explore those in subsequent posts.

I believe the moving average crossover technique is fairly promising and we will know more when the rolling backtest is done. However, investor attitude towards market timing is amusing. Before they understand what exactly is the effort involved, they want to time the market After they find out about the effort, they complain it is too much work, hard to change equity allocation, have to worry about tax, have to worry about load blah blah. Well if you want something in life, you have to lose something. One will have to objectively find out if the gain outweighs the loss and in most market timing methods, an objective investor will realise that the answer is yes.

 

Want to conduct a sales-free "basics of money management" session in your office?
I conduct free seminars to employees or societies. Only the very basics and getting-started steps are discussed (no scary math):For example: How to define financial goals, how to save tax with a clear goal in mind; How to use a credit card for maximum benefit; When to buy a house; How to start investing; where to invest; how to invest for and after retirement etc. depending on the audience. If you are interested, you can contact me: freefincal [at] Gmail [dot] com. I can do the talk via conferencing software, so there is no cost for your company. If you want me to travel, you need to cover my airfare (I live in Chennai)

Connect with us on social media


Do check out my books


You Can Be Rich Too with Goal-Based InvestingYou can be rich too with goal based investing

My first book is meant to help you ask the right questions, seek the right answers and since it comes with nine online calculators, you can also create customg solutions for your lifestye! Get it now . It is also available in Kindle format .

Gamechanger: Forget Startups, Join Corporate & Still Live the Rich Life You Want

Gamechanger: Forget Start-ups, Join Corporate and Still Live the Rich Life you want
My second book is meant for young earners to get their basics right from day one! It will also help you travel to exotic places at low cost! Get it or gift it to a youngearner

The ultimate guide to travel by Pranav Surya

Travel-Training-Kit-Cover This is a deep dive analysis into vacation planning, finding cheap flights, budget accommodation, what to do when travelling, how travelling slowly is better financially and psychologically with links to the web pages and hand-holding at every step. Get the pdf for ₹199 (instant download)

Create a "from start to finish" financial plan with this free robo advisory software template


Free Apps for your Android Phone

All calculators from our book, “You can be Rich Too" are now available on Google Play!
Install Financial Freedom App! (Google Play Store)
Install Freefincal Retirement Planner App! (Google Play Store)
Find out if you have enough to say "FU" to your employer (Google Play Store)

About Freefincal

Freefincal has open-source, comprehensive Excel spreadsheets, tools, analysis and unbiased, conflict of interest-free commentary on different aspects of personal finance and investing. If you find the content useful, please consider supporting us by (1) sharing our articles and (2) disabling ad-blockers for our site if you are using one. We do not accept sponsored posts, links or guest posts request from content writers and agencies.

Blog Comment Policy

Your thoughts are vital to the health of this blog and are the driving force behind the analysis and calculators that you see here. We welcome criticism and differing opinions. I will do my very best to respond to all comments asap. Please do not include hyperlinks or email ids in the comment body. Such comments will be moderated and I reserve the right to delete the entire comment or remove the links before approving them.

13 thoughts on “Timing the market by spotting bullish and bearish trends

  1. Good effort to introduce basics of technical analysis into otherwise ‘fundamentalist’ approach to mutual fund investment.

    It is inferred that the figures 150 and 364 for simple moving averages (SMA) denote half yearly and yearly averaging. But trade charts are normally calibrated in number of trading days and not in number of calendar days. There are just over 200 days trading days in an year and accordingly SMA (100) and SMA (200) are most preferred and popular time frames in trading parlours for half yearly and yearly averaging, respectively.

    Going by author’s preference of SMA (150) and SMA (364), there are of course countable few cross overs (in either way) in a span of 18 years, and makes the investment idea overly simplistic, because there are only few decisions to be made. But there a big drawback of money and time lost in that proposition. Let’s take some examples as tabulated below (figures and dates may not be accurate due to compression of chart, but still prove the point):
    Loss
    Date Nifty Percentage Days
    BUY Bottom 27 September 2001 890
    Cross over 18 August 2003 1281 43.93% 690

    SELL Peak 03 January 2008 6272
    Cross over 21 August 2008 4283 31.71% 231

    BUY Bottom 05 March 2009 2576
    Cross over 22 September 2009 5020 94.88% 201

    SELL Peak 05 November 2010 6312
    Cross over 10 August 2011 5161 18.24% 278

    BUY Bottom 21 December 2011 4693
    Cross over 18 September 2012 5600 19.33% 272

    SELL Peak 04 March 2015 8922
    Cross over 11 December 2015 7610 14.71% 282

    BUY Bottom 26 February 2016 7030
    Cross over 20 September 2016 8775 24.82% 207

    Nifty was lowest (bottom) on 27 September 2001 @ 890 points but SMA bullish cross over [SMA (150) crossing above SMA (364)] occurred only on 18 August 2003, which is the buy point as per author. But by then Nifty had already climbed to 1281 points, making an investment loss of almost 44%. The worse is that there was a time elapsed between these two dates (690 days) making an opportunity loss as well.

    On the sell side, Nifty peaked on 03 January 2008 @ 6272 points but SMA bearish cross over [SMA (150) crossing below SMA (364)] occurred only on 21 August 2008, which is the sell point as per author. But by then Nifty had already plummeted to 4283 points, making an investment loss of almost 32%. There was a time elapsed between these two dates (231 days) making an opportunity loss as well.

    The table above analyses five more such buy/ sell points using cross over methods proposed by the author. Across in all cases there are terrible time lags causing both investment and opportunity losses. This indicates that cross over span (150 & 364) is either too large, or additional technical lay-overs, oscillators or indicators are also to be adopted, in order to make prudent and timely buy/ sell decisions for optimum yield.

      1. A fair explanation Dinesh ji. Please share the other indicators/lay-overs that you have found to be useful in taking a decision. It would be great if these are supported by back-testing results.

        1. @ Gaurav Mehta:
          Thanks for response. The strongest indicators I find are the bullish and bearish divergence of RSI and MACD, to gather market reversals with high degree of accuracy. This goes with the caveat that indicators are not infallible; but if read along with other pulses of the market, they render less pain points in decision making of buy/ sell.

          For example, I have annotated twin bearish divergence (RSI & MACD) which went as a fore-warning before the legendary crash of 2007-2008; and the twin bullish divergence (RSI & MACD) which went as a harbinger of its dramatic recovery in 2009-2010 in Nifty Weekly charts. Wish I could share the chart in is this comment box. It is highly educational.

      2. Instead of cross overs of SMA (364) & SMA (150), if we use the pair of SMA (200) & SMA (100), there are about 16 cross overs in 18 years period of back test, which means 8 buy points and 8 sell points (not so many decision making). The yield can be dramatically improved and the losses in whipsaws are not significantly higher either. (The comment box doesn’t allow pasting or attaching the chart or tables).

    1. Issue at hand is twofold: (i) maximise gains in uptrend and (ii) minimise losses in whipsaws.

      Statistical data suggest that over a long run market is in the trending mode only 30% of the time. Don’t know whether this includes uptrend and downtrend. Also market falls at least twice as fast as it rises. So, even if we assume 30% as total uptrend time, give another 15% for down trend, market moves more than 50% of the time sideways. Entry/ exit in sideways market means getting caught in whipsaws. This implies that (i) and (ii) are equally important.

      For maximising gains, ideally one should aim at 100% of the span from bottom to peak in an uptrend which entails buying at the market bottom and selling at the market top, but even if we can capture 80% of the span from bottom to top, it is a great gain. Simple moving average (SMA) cross over is a good method to capture this span. Cross overs with a pair of SMA of large time frame like 364 & 150, reduce the risk of whipsaws but trim the gain because we end up entering and exiting too late. Shorter time frames of the pair of SMA increase the risk of whipsaws but also increase gains because entry and exit points are wider in the span. It also increases the number of buy and sell thereby increasing loading and tax expenses. It emerges that the time frames of the pair of SMA have to be carefully chosen by one’s own study through back testing on market charts and considering total financial gains, loading and tax expenses. Past may not be complete reference for future, but that is the only thing we have at our hands.

      To assist and validate entry and exit points in uptrend using moving average cross over method, bullish and bearish divergences on oscillators and cyclical indicators like RSI and MACD can be consulted. To escape being caught in whipsaws, trend following indicators like ADX and OBV can be consulted.

      1. Very useful explanation. Thanks for sharing. Do you have any article/video which gives a simple explanation of how to read and use RSI, MACD, ADX and OBV? It would be great if you could share the same here.

        1. Well, I am not a domain expert, but I am sure you will find plenty on Google. May also check out ChartSchool section of Stockcharts.com

  2. Many thanks for sharing this Pattu sir. Did some back-testing with other indices like small-cap 250 and mid-cap 100. The results, while not as strong as the Nifty 50, look very promising. I will be keenly awaiting a more detailed post as you have mentioned towards the end of the piece.

Leave a Reply

Your email address will not be published. Required fields are marked *