Notice: Function _load_textdomain_just_in_time was called incorrectly. Translation loading for the restrict-user-access domain was triggered too early. This is usually an indicator for some code in the plugin or theme running too early. Translations should be loaded at the init action or later. Please see Debugging in WordPress for more information. (This message was added in version 6.7.0.) in /home1/portfol1/public_html/wp/wp-includes/functions.php on line 6114

Deprecated: Class Jetpack_Geo_Location is deprecated since version 14.3 with no alternative available. in /home1/portfol1/public_html/wp/wp-includes/functions.php on line 6114

Deprecated: preg_split(): Passing null to parameter #3 ($limit) of type int is deprecated in /home1/portfol1/public_html/wp/wp-content/plugins/add-meta-tags/metadata/amt_basic.php on line 118
Moving Average | Portfolio Yoga

200 Bar Average

For a very long time, the 200 day average is seen as a barrier between bull and bear markets. While many a analyst questions the reasoning behind using the 200 and not 199 or 201 (which anyway will make for not much of a difference), the key reason 200 came to be seen as a major average was that in an earlier era, markets were open more or less 200 days in a year.

The key question though is should one use a simple moving average (DMA) or a exponential moving average for calculation. The key difference here being that while a simple moving average provides equal weight to all the bars, a exponential moving average provides more weight for recent data and less for the older data.

Exponential is what I personally prefer because I believe that if market data has predictive information, one should have much more weight for yesterday’s data bar than the data bar that is 10 months old. Of course, other than DMA and EMA, we have many a way to slice and dice the data when in comes to moving averages. For the sake of brevity, let me list out a few of them.

DEMA -> Double Exponential Moving Average

TEMA -> Triple Exponential Moving Average

WMA -> Weighted Moving Average

While much of the Industry usage is limited to DMA or EMA, lets test out the viability of all the above variations of the Moving Average to see if thinking differently leads to a better output.

The test is as usual conducted on Nifty Futures (Rolling – No Adjustments) with no compounding of position sizes. All trades are taken at the closing price. A commission / slippage factor of 0.05% per trade is applied. While 0.05% may appear excessive in these days of discount brokerage, traders paid a brokerage which was much higher than even that just a few years back.

Nifty was tested from 12-06-2000 till 24-04-2015. We took only long trades (no Shorts). The key numbers to look out for in my opinion are

1. Profit generated (measured in Points)

2. Maximum Draw-down (measured in % from the highest peak to the lowest trough)

3.  Number of Trades

So, here are the results

DMA

While no average is able to beat the Buy & Hold in terms of point returns, DEMA comes way close and as a added benefit is also one which has the lowest draw-down.

While the DMA was broken just today, the DEMA was broken way back on 9th March. But on the negative side, this average was broken multiple times over the last few months.

All in all, if you want to use a moving average that is not too short and not too long, 200 is worth a look.

 

 

 

Test of Moving Average

A interesting use of Moving Averages is in Mean Reversion. While many trend followers swear by a Moving Average (or Moving Average Crossover), its interesting that the same can also be used for a Mean Reversion strategy (not that I would recommend doing that).

This pic from Wikipedia showcases the same

Image

We can measure a trend in various ways. One way would be to see the number of times it retraces to its moving average before continuing with its previous trend. Based on that though, here are the charts on the number of times Nifty has come back to the moving average.

All data for 2014 is till date (30th May)

10 Day Moving Average

10

20 Day Moving Average

20

50 Day Moving Average

50

100 Day Moving Average

100

200 Day Moving Average

200

Based on just a overall view, the data above supports the fact that trend following has been pretty positive this year compared to say 2013. But shall it remain with low volatility and not too may dips remain to be seen