This is machine translation

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

Note: This page has been translated by MathWorks. Click here to see
To view all translated materials including this page, select Country from the country navigator on the bottom of this page.


Acceleration between times

tsaccel has been partially removed and will no longer accept a fints object (tsobj) argument. Use a vector, matrix, timetable, or table instead for financial time series.

Use fts2timetable to convert a fints object to a timetable object.


acceleration = tsaccel(Data)
acceleration = tsaccel(___,Name,Value)



acceleration = tsaccel(Data) calculates the acceleration of a data series with time distance of n periods.

n periods.


acceleration = tsaccel(___,Name,Value) adds optional name-value pair arguments.


collapse all

Load the file SimulatedStock.mat, which provides a timetable (TMW) for financial data for TMW stock.

load SimulatedStock.mat
TMW.Volume = []; % remove VOLUME field
acceleration = tsaccel(TMW);  
title('Acceleration for TMW')

Input Arguments

collapse all

Data with high, low, open, close information, specified as a vector, matrix, table, or timetable. For vector input, Data is a column vector of high, low, open, and closing prices stored in the corresponding columns. For matrix input, Data is an M-by-N column-oriented matrix of high, low, open, and closing prices stored in the corresponding columns. Timetables and tables with M rows must contain variables named 'High', 'Low', 'Open', and 'Close' (case insensitive).

Data Types: double | table | timetable

Name-Value Pair Arguments

Specify optional comma-separated pairs of Name,Value arguments. Name is the argument name and Value is the corresponding value. Name must appear inside quotes. You can specify several name and value pair arguments in any order as Name1,Value1,...,NameN,ValueN.

Example: accelearation = tsaccel(TMW,'NumPeriods',10,'Datatype',1)

Period difference for acceleration, specified as the comma-separated pair consisting of 'NumPeriods' and a scalar positive integer.

Data Types: double

Indicates if Data contains the data itself or the momentum of the data, specified as the comma-separated pair consisting of 'Datatype' and a scalar integer with a value of:

  • 0Data contains the data itself.

  • 1Data contains the momentum of the data.

Data Types: double

Output Arguments

collapse all

Acceleration series, returned with the same number of rows (M) and columns (N) and the same type (vector, matrix, table, or timetable) as the input Data.

More About

collapse all


Acceleration is defined as the difference of two momentum series separated by n periods.

Acceleration is the difference of the current momentum with the momentum n periods ago. By default, acceleration is based on 12-period difference.


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

Introduced before R2006a