MailBag

How do I Create a Double-Smoothed Moving Average?

 | 

Q: I want to create a 10-day moving average of a 10-day moving average of $TICK.  How can I do that?

A: While double smoothed moving averages are not something that we support directly there is a way to show them on our charts using a nifty trick involving the MACD indicator.

(Note: This method assumes that you want to use Exponential Moving Averages, not Simple Moving Averages.)

The key to the trick is to understand that EMA(0) is defined as zero AND that the MACD(x,y) is defined as EMA(x) minus EMA(y).

Taken together, those two facts mean that you can plot any EMA you want in an INDICATOR panel by adding "MACD(x,0)" to your chart.  MACD(x,0) = EMA(x) - EMA(0) = EMA(x) - 0 = EMA(x).

So, in this case, we want to plot "MACD(10,0)" as an indicator on our $TICK chart.  It's the dim red line in the upper panel on the chart below - notice how it is the same as the bright red EMA(10) overlay.  After doing that, we can then use the "Advanced Options" for our indicator to add the second blue EMA(10) on top.  We can then adjust the "Opacity" setting to dim out the $TICK and MACD lines and Voila!

Sc
 
The blue line in the top panel is now a double-smoothed EMA of $TICK.

Chip Anderson
About the author: is the founder and president of StockCharts.com. He founded the company after working as a Windows developer and corporate consultant at Microsoft from 1987 to 1997. In this blog, Chip shares his tips and tricks on how to maximize the tools and resources available at StockCharts.com, and provides updates about new features or additions to the site. Learn More
Subscribe to MailBag to be notified whenever a new post is added to this blog!
comments powered by Disqus