![]()
MOVING AVERAGE
A moving average is simply calculated from the average price of a security at a given time. When calculating a moving average, you can specify the appropriate time span to calculate the average price (e.g. 10 days).
The most commonly used moving averages are 10 days, 50 days and 250 days. But you can still enter the appropriate time span in the boxes on the middle top of our Java Charting System.
1) Simple Moving Average (SMA)
SMA is calculated by adding the security's prices for the most recent "n" time periods and then dividing by "n." For example, adding the closing prices of a security for most recent 14 days and then dividing by 14. The result is the security's average price over the last 14 days. This calculation is done for each period in the chart.
2) Weighted Moving Average (WMA)
WMA is designed to put more weight on recent data and less weight on past data. WMA is calculated by multiplying each of the previous day
’s data by a weight. The weight is based on the number of days in the moving average (e.g. 10-day, 20-day, 50-day, 100-day, 250-day).For example, a 5-day WMA will be calculated as follows:
|
Closing Price |
Weight |
Sum |
|
|
Day ( n - 4 ) |
10 |
1 |
10 |
|
Day ( n - 3 ) |
11 |
2 |
22 |
|
Day ( n - 2 ) |
12 |
3 |
36 |
|
Day ( n - 1 ) |
15 |
4 |
60 |
|
Day ( n ) |
16 |
5 |
80 |
|
(where n = 5) |
Sub-total: |
15 |
208 |
|
|
|
|
|
|
|
WMA(5) in day (n ) |
= 13.87 (208/15) |
|
3) Exponential Moving Average (EMA)
In order to reduce the lag in simple moving averages, technical analysts sometimes use exponential moving averages (EMA), or exponentially weighted moving averages (EWMA). To some extent, the intuition of EMA is similar to WMA as both of them reduce the lag by applying more weight to recent prices relative to older prices. The weighting applied to the most recent price depends on the length of the moving average. The shorter the EMA is, the more weight that will be applied to the most recent price. We should bear in mind that the EMA puts more weight on recent prices than older prices and thus it will react quicker to recent price changes than a SMA.
The formula for an EMA is:
X = (K x (C - P)) + P
X = Current EMA C = Current Price P = Previous period's EMA*
K (a smoothing constant) = 2 / (1 + N) N = no. of periods for EMA
(*A SMA is used for first period's calculation)

Moving average represents the consensus of investor expectations over a specific time span (e.g. 20 days). If the security's price is above its moving average, it means that investor's current expectations (i.e., the current price) are greater than their average expectations over 20 days, and that investors are becoming increasingly bullish on the security, and vice versa. Investors typically buy when a security's price rises above its moving average and sell when the price drops below its moving average.