c_exponential_moving_average_5d_close_split_adjusted#

c_exponential_moving_average_5d_close_split_adjusted(m_close_split_adjusted)[source]

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

Parameters:

m_close_split_adjusted (DataColumn) – The adjusted close prices.

Returns:

The 5-day exponential moving average.

Return type:

DataColumn

Notes

The smoothing factor K is given by:

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

with n = 5. 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 B6, enter:

    =AVERAGE(A2:A6)
    
  2. In cell B7, enter:

    =(A7 * (2/(5+1))) + (B6 * (1 - (2/(5+1))))
    
  3. Drag the formula down to apply it to the remaining rows.