what is a moving average ma 
in finance a moving average ma is a stock indicator commonly used in technical analysis the reason for calculating the moving average of a stock is to help smooth out the price data by creating a constantly updated average price by calculating the moving average the impacts of random short term fluctuations on the price of a stock over a specified time frame are mitigated simple moving averages smas use a simple arithmetic average of prices over some timespan while exponential moving averages emas place greater weight on more recent prices than older ones over the time period investopedia yurle villegasunderstanding a moving average ma moving averages are calculated to identify the trend direction of a stock or to determine its support and resistance levels it is a trend following or lagging indicator because it is based on past prices the longer the period for the moving average the greater the lag a 200 day moving average will have a much greater degree of lag than a 20 day ma because it contains prices for the past 200 days 50 day and 200 day moving average figures are widely followed by investors and traders and are considered to be important trading signals investors may choose different periods of varying lengths to calculate moving averages based on their trading objectives shorter moving averages are typically used for short term trading while longer term moving averages are more suited for long term investors while it is impossible to predict the future movement of a specific stock using technical analysis and research can help make better predictions a rising moving average indicates that the security is in an uptrend while a declining moving average indicates that it is in a downtrend similarly upward momentum is confirmed with a bullish crossover which occurs when a short term moving average crosses above a longer term moving average conversely downward momentum is confirmed with a bearish crossover which occurs when a short term moving average crosses below a longer term moving average 1types of moving averagesa simple moving average sma is calculated by taking the arithmetic mean of a given set of values over a specified period a set of numbers or prices of stocks are added together and then divided by the number of prices in the set the formula for calculating the simple moving average of a security is as follows sma a1 a2 annwhere a average in period nn number of time periods begin aligned sma frac a 1 a 2 dotso a n n textbf where a text average in period n n text number of time periods end aligned sma na1 a2 an where a average in period nn number of time periods charting stock prices over 50 days using a simple moving average may look like this image by sabrina jiang investopedia 2021the exponential moving average gives more weight to recent prices in an attempt to make them more responsive to new information to calculate an ema the simple moving average sma over a particular period is calculated first then calculate the multiplier for weighting the ema known as the smoothing factor which typically follows the formula 2 selected time period 1 for a 20 day moving average the multiplier would be 2 20 1 0 0952 the smoothing factor is combined with the previous ema to arrive at the current value the ema thus gives a higher weighting to recent prices while the sma assigns an equal weighting to all values emat vt s1 d emay 1 s1 d where emat ema todayvt value todayemay ema yesterdays smoothingd number of days begin aligned ema t left v t times left frac s 1 d right right ema y times left 1 left frac s 1 d right right textbf where ema t text ema today v t text value today ema y text ema yesterday s text smoothing d text number of days end aligned emat vt 1 ds emay 1 1 ds where emat ema todayvt value todayemay ema yesterdays smoothingd number of days simple moving average sma vs exponential moving average ema the calculation for ema puts more emphasis on the recent data points because of this ema is considered a weighted average calculation in the figure below the number of periods used in each average is 15 but the ema responds more quickly to the changing prices than the sma the ema has a higher value when the price is rising than the sma and it falls faster than the sma when the price is declining this responsiveness to price changes is the main reason why some traders prefer to use the ema over the sma image by sabrina jiang investopedia 2020example of a moving averagethe moving average is calculated differently depending on the type sma or ema below we look at a simple moving average sma of a security with the following closing prices over 15 days a 10 day moving average would average out the closing prices for the first 10 days as the first data point the next data point would drop the earliest price add the price on day 11 and take the average a bollinger band technical indicator has bands generally placed two standard deviations away from a simple moving average in general a move toward the upper band suggests the asset is becoming overbought while a move close to the lower band suggests the asset is becoming oversold since standard deviation is used as a statistical measure of volatility this indicator adjusts itself to market conditions 