This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English verison of the page.

Note: This page has been translated by MathWorks. Please click here
To view all translated materals including this page, select Japan from the country navigator on the bottom of this page.


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.


Momentum is the difference between two prices (data points) separated by a number of times.

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.


collapse all

This example shows how to calculate the momentum of a data series for Disney stock and plot the results.

load disney.mat
dis = rmfield(dis,'VOLUME'); % remove VOLUME field
dis_Mom = tsmom(dis);  
title('Momentum for Disney')


[1] Kaufman, P. J. The New Commodity Trading Systems and Methods. John Wiley and Sons, New York, 1987.

Introduced before R2006a

Was this topic helpful?