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