c_simple_moving_average_21d_close_split_adjusted#
- c_simple_moving_average_21d_close_split_adjusted(m_close_split_adjusted)[source]
Calculate the 21-day (1 month) simple moving average (SMA) of the split-adjusted close prices.
- Parameters:
m_close_split_adjusted (DataColumn) – The adjusted close prices.
- Returns:
The 21-day simple moving average.
- Return type:
Notes
The 21-day simple moving average is computed as:
\[\mathrm{SMA}_{21} = \frac{1}{21} \sum_{i=0}^{21} \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:A22)
Drag the formula down to calculate the 21-day SMA for the rest of the rows.