tsaccel

Acceleration between times

Syntax

acc = tsaccel(data, nTimes, datatype)
accts = tsaccel(tsobj, nTimes, datatype)

Arguments

data

Data series.

nTimes

(Optional) Number of times. Default = 12.

datatype

(Optional) Indicates whether data contains the data itself or the momentum of the data:

0 = Data contains the data itself (default).

1 = Data contains the momentum of the data.

tsobj

Name of an existing financial time series object.

Description

Acceleration is the difference of two momentums separated by some number of periods.

acc = tsaccel(data, nTimes, datatype) calculates the acceleration of a data series, essentially the difference of the current momentum with the momentum some number of periods ago. If nTimes is specified, tsaccel calculates the acceleration of a data series data with time distance of nTimes times.

accts = tsaccel(tsobj, nTimes, datatype) calculates the acceleration of the data series in the financial time series object tsobj, essentially the difference of the current momentum with the momentum some number of periods ago. Each data series in tsobj is treated individually. accts is a financial time series object with similar dates and data series names as tsobj.

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

expand all

Calculate the Acceleration of a Data Series

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

load disney.mat
dis = rmfield(dis,'VOLUME'); % remove VOLUME field
dis_Accel = tsaccel(dis);
plot(dis_Accel)
title('Acceleration for Disney')

References

Kaufman, P. J., The New Commodity Trading Systems and Methods, New York: John Wiley & Sons, 1987.

See Also

Was this topic helpful?