The simple moving average (SMA) is the standard moving average calculation that gives every price point in the average equal emphasis, or weight. For example, a five-day SMA is the sum of the most recent five closing prices divided by five. Weighted moving averages give extra emphasis to more recent price action. Exponential moving average (EMA) weights prices using the following formula:

EMA = SC * Price + (1 - SC) * EMA(yesterday)
where

SC is a “smoothing constant” between 0 and 1, and EMA(yesterday) is the previous day’s EMA value.

You can approximate a particular SMA length for an EMA by using the following formula to calculate the equivalent smoothing constant:

SC = 2/(n + 1)
where

n = the number of days in a simple moving average of approximately equivalent length.
For example, a smoothing constant of 0.095 creates an exponential moving average equivalent to a 20-day SMA (2/(20 + 1) = 0.095). The larger n is, the smaller the constant, and the smaller the constant, the less impact the most recent price action will have on the EMA. In practice, most software programs allow you to simply choose how many days you want in your moving average and select either simple, weighted, or exponential calculations

0 comments