c_simple_moving_average_5d_close_split_adjusted#
- c_simple_moving_average_5d_close_split_adjusted(m_close_split_adjusted)[source]
Calculate the 5-day (1 week) simple moving average (SMA) of the split-adjusted close prices.
- Parameters:
m_close_split_adjusted (DataColumn) – The adjusted close prices.
- Returns:
The 5-day simple moving average.
- Return type:
Notes
The 5-day simple moving average is computed as:
\[\mathrm{SMA}_{5} = \frac{1}{5} \sum_{i=0}^{5} \mathrm{Adjusted\ Close}_{t-i}\]In Excel, assuming your adjusted close prices are in column A starting at cell A2:
In cell B6, enter:
=AVERAGE(A2:A6)
Drag the formula down to calculate the 5-day SMA for the rest of the rows.