## Documentation Center |

Moving average

`output = tsmovavg(tsobj,'s',lag,dim)`example`output = tsmovavg(vector,'s',lag,dim)`

`output = tsmovavg(tsobj,'e',timeperiod,dim)`example`output = tsmovavg(vector,'e',timeperiod,dim)`

`output = tsmovavg(tsobj,'t',numperiod,dim)`example`output = tsmovavg(vector,'t',numperiod,dim)`

`output = tsmovavg(tsobj,'w',weights,dim)`example`output = tsmovavg(vector,'w',weights,dim)`

`output = tsmovavg(tsobj,'m',numperiod,dim)`example`output = tsmovavg(vector,'m',numperiod,dim)`

` output = tsmovavg(tsobj,'e',timeperiod,dim)` returns
the exponential weighted moving average for financial time series
object,

` output = tsmovavg(vector,'e',timeperiod,dim)` returns
the exponential weighted moving average for a vector. The exponential
moving average is a weighted moving average, where

` output = tsmovavg(tsobj,'t',numperiod,dim)` returns
the triangular moving average for financial time series object,

` output = tsmovavg(vector,'t',numperiod,dim)` returns
the triangular moving average for a vector. The triangular moving
average double-smooths the data.

` output = tsmovavg(tsobj,'w',weights,dim)` returns
the weighted moving average for the financial time series object,

` output = tsmovavg(vector,'w',weights,dim)` returns
the weighted moving average for the vector by supplying weights for
each element in the moving window. The length of the weight vector
determines the size of the window. If larger weight factors are used
for more recent prices and smaller factors for previous prices, the
trend is more responsive to recent changes.

` output = tsmovavg(tsobj,'m',numperiod,dim)` returns
the modified moving average for the financial time series object,

` output = tsmovavg(vector,'m',numperiod,dim)` returns
the modified moving average for the vector. The modified moving average
is similar to the simple moving average. Consider the argument

Achelis, Steven B., *Technical Analysis from A to Z*,
Second printing, McGraw-Hill, 1995, pp. 184-192.

Was this topic helpful?