Documentation

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.

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

collapse all

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. John Wiley & Sons, New York, 1987.

Introduced before R2006a

Was this topic helpful?