Products & Services Solutions Academia Support User Community Company

Learn more about Financial Toolbox   

tsmom - Momentum between times

Syntax

mom = tsmom(data, nTimes)
momts = tsmom(tsobj, nTimes)

Arguments

data

Data series. Column-oriented vector or matrix.

nTimes

(Optional) Number of times. Default = 12.

tsobj

Financial time series object.

Description

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.

Examples

Compute the momentum for Disney stock and plot the results:

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

See Also

tsaccel

  


Free Interactive Computational Finance CD

View demos and recorded presentations led by industry experts.

Now On Demand
Network with industry peers and learn the latest applications of the leading software product for computational finance.

 © 1984-2009- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS