FACTOID # 98: Members of the armed forces and the police cannot vote in the Dominican Republic.
 
 Home   Encyclopedia   Statistics   Countries A-Z   Flags   Maps   Education   Forum   FAQ   About 
 
WHAT'S NEW
RECENT ARTICLES
More Recent Articles »
 

FACTS & STATISTICS    Simple view

  1. Select countries to view: (hold down Control key and click to select several)

     

     

    Compare:

     

     

  1. Select fact or statistic: (* = graphable)

     

     

     

  2. (OPTIONAL) Compare to statistic: (both need to be graphable)

     

     

     

  3. View result as:

     

       
(OR) SEARCH ALL encyclopedia, stats & forums:   

Encyclopedia > Moving average (finance)

A moving average, in finance and especially in technical analysis, is one of a family of similar statistical techniques used to analyze time series data. Technical analysis (or chartism) is the study of price movement and trend in markets in order to forecast future prices. ... In statistics and signal processing, a time series is a sequence of data points, measured typically at successive times, spaced apart at uniform time intervals. ...


A moving average series can be calculated for any time series, but is most often applied to stock prices, returns or trading volumes. Moving averages are used to smooth out short-term fluctuations, thus highlighting longer-term trends or cycles. The threshold between short-term and long-term depends on the application, and the parameters of the moving average will be set accordingly. In economics and business, the price is the assigned numerical monetary value of a good, service or asset. ... In finance, the return on investment (ROI) or just return is a calculation used to determine whether a proposed investment is wise, and how well it will repay the investor. ...


Mathematically, each of these moving averages is an example of a convolution. These averages are also similar to the low-pass filters used in signal processing. For the computer science usage see convolution (computer science) . In mathematics and in particular, functional analysis, convolution is a mathematical operator which takes two functions f and g and produces a third function that in a sense represents the amount of overlap between f and a reversed and translated version... A low-pass filter is a filter that passes low frequencies well, but attenuates (or reduces) frequencies higher than the cutoff frequency. ... Signal processing is the processing, amplification and interpretation of signals and deals with the analysis and manipulation of signals. ...

Contents


Simple moving average

A simple moving average is the unweighted mean of the previous n data points. For example, a 10-day simple moving average of closing price is the mean of the previous 10 days' closing prices. If those prices are p1 to pn then the formula is In mathematics and statistics, the arithmetic mean of a set of numbers is the sum of all the members of the set divided by the number of items in the set (cardinality). ...

SMA = { p_1 + p_2 + cdots + p_n 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,

SMA_{today} = SMA_{yesterday} + {p_1 over n} - {p_{n+1} over n}

In technical analysis there are various popular values for n, like 10 days, 40 days, or 200 days. The period selected depends on the kind of movement one is concentrating on, such as short, intermediate, or long term. In any case moving average levels are interpreted as support in a rising market, or resistance in a falling market. The support level is the lowest price a security trades at, over a period of time. ... The resistance level is the highest price a security trades at over a period of time. ...


In all cases a moving average lags behind the latest price action, simply from the nature of its smoothing. An SMA can lag to an undesirable extent, and can be influenced too much by old prices dropping out of the average. This is addressed by giving extra weight to recent prices, as in the following two methods.


Weighted moving average

A weighted average is any average that has multiplying factors to give different weights to different data points. But in technical analysis a weighted moving average (WMA) has the specific meaning of weights which decrease arithmetically. In an n-day WMA the latest day has weight n, the second latest n-1, etc, down to zero.

WMA = { n p_1 + (n-1) p_2 + cdots + 2 p_{n-1} + p_n over n + (n-1) + cdots + 2 + 1}

When calculating the WMA across successive values, it can be noted an amount p2 to pn + 1 drops out of the numerator each day. The WMA can thus be calculated starting with the above formula but then stepping successively with just additions and subtractions, not a full set of multiplications,

Totaltoday = Totalyesterday + p1pn + 1
Numeratortoday = Numeratoryesterday + np1Totalyesterday
WMA_{today} = { Numerator_{today} over n + (n-1) + cdots + 2 + 1}
WMA weights N=15

The denominator, incidentally, is a triangle number, and equals n(n+1)over2 Image File history File links Download high resolution version (1300x975, 7 KB) Summary This graph was created by me using the following bit of gnuplot set terminal png size 1300, 975 # set xlabel Days ago (0 today, 1 yesterday, etc) 0, -2 # # something evil happens with xtics axis, need dummy... Image File history File links Download high resolution version (1300x975, 7 KB) Summary This graph was created by me using the following bit of gnuplot set terminal png size 1300, 975 # set xlabel Days ago (0 today, 1 yesterday, etc) 0, -2 # # something evil happens with xtics axis, need dummy... A triangular number is a number that can be arranged in the shape of an equilateral triangle. ...


The graph at the right shows how the weights decrease, from highest weight for the most recent days, down to zero. It can be compared to the weights in the exponential moving average which follows.


Exponential moving average

EMA weights N=15

An exponential moving average (EMA), sometimes also called an exponentially weighted moving average (EWMA), applies weighting factors which decrease exponentially. The weighting for each day decreases by a factor, or percentage, on the one before it. The graph at right shows an example of the decrease. Image File history File links Download high resolution version (1300x975, 7 KB) This graph was created by me using the following bit of gnuplot set terminal png size 1300, 975 # set xlabel Days ago (0 today, 1 yesterday, etc) 0, -2 # # something evil happens with xtics axis, need dummy xlabel... Image File history File links Download high resolution version (1300x975, 7 KB) This graph was created by me using the following bit of gnuplot set terminal png size 1300, 975 # set xlabel Days ago (0 today, 1 yesterday, etc) 0, -2 # # something evil happens with xtics axis, need dummy xlabel... In mathematics, exponentiation is a process generalized from repeated (or iterated) multiplication, in much the same way that multiplication is a process generalized from repeated addition. ...


There are two ways to express this decrease. Firstly as a percentage whereby in say a 10% EMA, each weight is 10% less than the previous, ie. a multiplier factor f = 0.90. Or secondly, and more commonly, as an n days where the factor is, by convention, f=1-{2over{n+1}}. For instance n = 19 is equivalent to the 10%. In either case the formula for calculating successive days is

EMA_{today} = {p_1 + f times EMA_{yesterday} over 1 + f}

The full formula for a given day is

EMA = { p_1 + f p_2 + f^2 p_3 + f^3 p_4 + cdots over 1 + f + f^2 + f^3 + cdots }

In theory this is an infinite sum, but because f is less than 1, the terms become smaller and smaller, and can be ignored once small enough. The denominator approaches 1 over {1-f}, and that value can be used instead of adding up the powers, provided one is using enough terms that the omitted portion is negligible. In mathematics, a series is a sum of a sequence of terms. ...


The n in an n-day EMA only specifies the f factor. It isn't a stopping point for the calculation in the way n is in an SMA or WMA. The first n days in an EMA do represent about 86% of the total weight in the calculation though.


The power formula above gives a starting value for a particular day, after which the successive days formula shown first can be applied. It's interesting to note one can get the same result as the powering by applying the successive formula starting from far enough back, with an initial EMAyesterday of 0. In mathematics, a power series (in one variable) is an infinite series of the form where the coefficients an, the center c, and the argument x are usually real or complex numbers. ...


Either way, the question of how far back to go for an initial value depends, in the worst case, on the data. If there are huge p price values in old data then they'll have an effect on the total even if their weighting is very small. If one assumes prices don't vary too wildly then just the weighting can be considered, and work out how much weight is omitted by stopping after say k terms. This is (f^k + f^{k+1} + cdots), which is f^k times (1 + f + f^2 cdots), ie. a fraction fk out of the total weight.


Thus if the aim was to have 99.9% of the weight then k={ log 0.001 over log f} many terms should be used. And what's more it can be shown log,f approaches -2 over n+1 as n increases, so this simplifies to (roughly) k=3.45times(n+1) for this example 99.9% weight.


Other weightings

Other weighting systems are used occasionally – for example, a volume weighting will weight each time period in proportion to its trading volume.


There are weighting systems designed using a combination of moving averages: The DEMA indicator (Double Exponential Moving Average) and TEMA indicator (Triple Exponential Moving Average) are unique composites of a single exponential moving average, a double exponential moving average, and in the latter case a triple exponential moving average that provides less lag than either of the three components individually. They were originally introduced January 1994 by Patrick Mulloy.


The TRIX indicator uses a triple-EMA in its calculation. This ends up as just a certain set of weights on past data, and a set quite different to a plain EMA actually. Trix (or TRIX) is a technical analysis oscillator developed in the 1980s by Jack Hutson, editor of Technical Analysis of Stocks and Commodities magazine. ...


References


  Results from FactBites:
 
Finance Overload Technical Analysis (1583 words)
The interpretation of an indicator's moving average is similar to the interpretation of a security's moving average: when the indicator rises above its moving average, it signifies a continued upward movement by the indicator; when the indicator falls below its moving average, it signifies a continued downward movement by the indicator.
A simple, or arithmetic, moving average is calculated by adding the closing price of the security for a number of time periods (e.g., 12 days) and then dividing this total by the number of time periods.
A variable moving average is an exponential moving average that automatically adjusts the smoothing percentage based on the volatility of the data series.
Moving Averages at Trade10.com- The science of trading market momentum for stocks, options, futures and bonds. (1435 words)
A longer 50 day moving average is smoothed more than an 18 day moving average with each new day's data making less impact on the calculation of the moving average value than a shorter term moving average such as the 18 day moving average.
Since a moving average is a lagging indicator of price trend, there is a trade off between timeliness of a signal of bias change in the price trend being analyzed and the reduction of the possibility of whipsaw.
Moving averages can also be used on indicators such as the Stochastic, Relative Strength Index and the Rate of Change in order to smooth daily fluctuations and reduce potential whipsaws.
  More results at FactBites »


 

COMMENTARY     


Share your thoughts, questions and commentary here
Your name
Your comments
Please enter the 5-letter protection code

Want to know more?
Search encyclopedia, statistics and forums:

 


Lesson Plans | Student Area | Student FAQ | Reviews | Press Releases |  Feeds | Contact
The Wikipedia article included on this page is licensed under the GFDL.
Images may be subject to relevant owners' copyright.
All other elements are (c) copyright NationMaster.com 2003-5. All Rights Reserved.
Usage implies agreement with terms.