Searching...
Sunday, February 9, 2014

How to add a trend or Moving Average line to a chart in Excel

In statistics, a moving average (rolling average or running average) is a calculation to analyze data points by creating a series of averages of different subsets of the full data set. It is also called a moving mean (MM) or rolling mean and is a type of finite impulse response filter. Variations include: simple, and cumulative, or weighted form.

In financial applications a simple moving average (SMA) is the unweighted mean of the previous n datum points. Moving-average levels can be interpreted as support in a rising market, or resistance in a falling market.  If the prices are p_{M},p_{{M-1}},\dots ,p_{{M-(n-1)}} then the formula is
{\textit  {SMA}}={p_{M}+p_{{M-1}}+\cdots +p_{{M-(n-1)}} \over n}
When calculating successive values, a new value comes into the sum and an old value drops out, meaning a full summation each time is unnecessary for this simple case,

{\textit  {SMA}}_{{\mathrm  {today}}}={\textit  {SMA}}_{{\mathrm  {yesterday}}}-{p_{{M-n}} \over n}+{p_{{M}} \over n}
You can use excel formulas to create a trend line on a stock chart you just created in Excel. However, Excel is also smart enough to do this for you. You can add a trend line to the chart using below steps. Assume you have a chart as below to which you would like to add the trend line to


1. Right-Click on the data series of the chart to get the following menu


 2. Cick on Add Trendline option, you will get the following menu



3. Choose Moving Average option, Input 10 days to the Period to get the 10 day moving average. Adjusting the line color and style from the same menu will give you something like below




You can now see a trend line in your graph without having to use the formulas at all. You may also add more than one trend line to improve your analysis. While analyzing stock trends, the 10 day and 21 day Moving averages are mostly used for short term trend.


 

0 comments:

Post a Comment

 
Back to top!