Momentum between times
mom = tsmom(data, nTimes) momts = tsmom(tsobj, nTimes)
Data series. Column-oriented vector or matrix.
(Optional) Number of times. Default = 12.
Financial time series object.
mom = tsmom(data, nTimes) calculates the momentum of a data series data. If nTimes is specified, tsmom uses that value instead of the default 12.
momts = tsmom(tsobj, nTimes) calculates the momentum of all data series in the financial time series object tsobj. Each data series in tsobj is treated individually. momts is a financial time series object with similar dates and data series names as tsobj. If nTimes is specified, tsmom uses that value instead of the default 12.
Note, to compute a quantity over n periods, you must specify n+1 for nTimes. If you specify nTimes = 0, the function returns your original time series.
Kaufman, P. J., The New Commodity Trading Systems and Methods, John Wiley and Sons, New York, 1987.