Another function that can be used in charts for online trading is the **moving average**, which is widely used for the analysis of story series and especially for technical analysis. On the trading platforms (** we recommend this one**) you can set this type of graphic function and usually find three types: simple, exponential, and weighted.

In this lesson we will detail what these **three types of moving averages** are and how they differ, without going too far into technical details that you can explore personally later depending on your needs.

## Simple Moving Average

The **simple moving average** (SMA) is also called **arithmetic average** and is in fact the most widely used by analysts and by those who trade online. The data of a given period is used and the average is calculated simply by adding it together and dividing the total by the number of values (e.g., 3 + 5 + 6 + 8 and divided by 4). However, the simple moving average is subject to criticism because it assigns the same importance (or weight) to each value. In practice, if we had a 10-period moving average, the same weight would be given to every single value (each of the 10 periods is 10%).

## Weighted Moving Average

The **weighted moving average** (WMA) is used to address the previously highlighted problem with the simple moving average. **Greater weight is given to the last values of a series**. As for the final calculation, this remains unchanged: all the values of the same series are added together. For example, if we had 10 periods we would associate “weight” 1 to the first value, “weight” 2 to the second, and so on. These “weights” must be multiplied by the value of the data. For example, if the first period has a value of 3, we will multiply it by weight 1 and it will ultimately have a value of 3. If the fifth period is 7, we will multiply it by 5 and obtain a last value of 35. In the end, we add up the final values and divide them by the sum of the weights used. Example with three periods (5-6-7): the result will be [(5 × 1) + (6 × 2) + (7 × 3) / (1 + 2 + 3)] or 38/6 = 6.3333.

Even this is subject to criticism because it fails to instantaneously provide an idea of what is happening on the market.

## Exponential Moving Average

The **exponential moving average** (EMA) is much more complex than the averages described above and is therefore used by more experienced users. As in the weighted average,** a different weight is assigned to the various prices** (or values) being considered, greater for the most recent and lesser for the oldest, with the major difference being that it takes into account much more data (e.g., many “older” values).

Being a very difficult calculation medium, it is practically impossible to generate except through the use of a computer. By the way, we can get a perfect EMA with a single mouse clic, on the trading platform.

However, to calculate the exponential moving average two values are taken into consideration:

- The arithmetic mean (seen previously)
- The Alpha coefficient, which will make the average more reactive.

To calculate Alpha, use this formula:

Alpha = 2/(n + 1) where n is the number of periods.

The exponential moving average is obtained by:

EMA (exp. M.) = (Close – previous EMA) * Alpha + previous EMA

With respect to the weighted average, **the weighting coefficients are assigned with an exponential and non-linear progressive value.** The difference in “weight” between the different values, therefore, varies exponentially.

Go to lesson 15 – **Alligator indicator**