c_daily_traded_value_sma_21d#

c_daily_traded_value_sma_21d(c_daily_traded_value)[source]

Calculate the 21-day simple moving average of the daily traded value.

Parameters:

c_daily_traded_value (DataColumn) – The daily traded value.

Returns:

The 21-day moving average of the daily traded value.

Return type:

DataColumn

Notes

The 21-day moving average is computed as:

\[\mathrm{MA}_{21} = \frac{1}{21} \sum_{i=1}^{21} \mathrm{Daily\ Traded\ Value}_{i}\]

In Excel, assuming your daily traded values are in column A starting at cell A2:

  1. In cell B22, enter:

    =AVERAGE(A2:A22)

  2. Drag the formula from cell B22 down to calculate the 21-day moving average for the rest of the rows.