Moving Average
A moving average (MA) is a widely used statistical calculation that is used to analyze data points by creating a series of averages of different subsets of the full dataset. It is most often used in time series analysis to identify trends, cycles, and other patterns in the data.
In finance, moving averages are primarily used to smooth out price data and other indicators by creating a constantly updated average price. The most common applications of MAs are to identify trend direction and to determine support and resistance levels.
There are different types of moving averages, including:
- Simple Moving Average (SMA): This is the simplest type of MA, computed by adding up a number of data points and then dividing by the number of data points. For example, a 7-day SMA adds up the closing prices for the last 7 days and then divides by 7.
- Exponential Moving Average (EMA): This type of MA gives more weight to recent data points, making it more responsive to new information.
- Weighted Moving Average (WMA): This MA assigns a specific weight to each data point. The more recent the data point, the greater the weight it carries.
For example, if you were looking at a chart of a stock’s closing prices, a 50-day moving average would plot the average closing price over the previous 50 trading days, recalculated each day. This would help you identify whether the stock’s price was generally trending upward, downward, or remaining relatively steady over that period.
Example of Moving Average
Let’s create a simple example using a simple moving average (SMA) over 3 days. Suppose we have a stock with the following closing prices over a 5-day period:
- Day 1: $10
- Day 2: $11
- Day 3: $12
- Day 4: $15
- Day 5: $14
We can calculate a 3-day SMA for each day starting from Day 3.
- On Day 3, the 3-day SMA is: ($10+$11+$12)/3 = $11
- On Day 4, the 3-day SMA is: ($11+$12+$15)/3 = $12.67 (rounded to two decimal places)
- On Day 5, the 3-day SMA is: ($12+$15+$14)/3 = $13.67 (rounded to two decimal places)
As you can see, the moving average increases from $11 on Day 3 to $13.67 on Day 5, showing an uptrend in the price of the stock.
Remember, the 3-day SMA is recalculated every day by averaging the closing prices of the stock for the last three days. It’s “moving” because as new data becomes available, the oldest data is dropped and the newest data replaces it. This gives you a constantly updated average price.
In the real world, moving averages like the 50-day and 200-day SMAs are commonly used by traders and analysts to identify long-term price trends. It’s also common to use two moving averages of different periods (like a 50-day and a 200-day) together in the same chart to generate trading signals when the two averages cross each other.