c_exponential_moving_average_252d_close_split_adjusted#

c_exponential_moving_average_252d_close_split_adjusted(m_close_split_adjusted)[source]

Calculate the 252-day (1 year) exponential moving average (EMA) of the split-adjusted close prices.

Parameters:

m_close_split_adjusted (DataColumn) – The adjusted close prices.

Returns:

The 252-day exponential moving average.

Return type:

DataColumn

Notes

The smoothing factor K is given by:

\[K = \frac{2}{n + 1}\]

with n = 252. The EMA is then:

\[\mathrm{EMA}_{\mathrm{current}} = (\mathrm{Adjusted\ Close} \times K) + (\mathrm{EMA}_{\mathrm{previous}} \times (1 - K))\]

In Excel, assuming adjusted close prices are in column A starting at cell A2:

  1. In cell B253, enter:

    =AVERAGE(A2:A253)
    
  2. In cell B254, enter:

    =(A254 * (2/(252+1))) + (B253 * (1 - (2/(252+1))))
    
  3. Drag the formula down to apply it to the remaining rows.