Table of contents
- Simple Moving Average
- Definition
- Code examples
- Plot time series and simple moving average in R
- Trading time series
- Trading time series with simple moving average applied
Simple Moving Average
Definition
The simple moving average of order \(2q + 1\) centred on \(t\) is given by the transformation
\[\begin{equation} MA(t) = \frac{1}{2q + 1}(X_{t-q} + \ldots + X_t + \ldots + X_{t+q}) \end{equation}\] Code examples
Plot time series and simple moving average in R
Trading time series
Trading time series with simple moving average applied