Main Content

prcroc

价格rate of change

prcrochas been partially removed and will no longer accept a弗林特object (tsobj) argument. Use a matrix,timetable, ortableinstead for financial time series.

Usefts2timetableto convert a弗林特object to atimetableobject.

Description

example

价格ChangeRate= prcroc(Data)calculates the price rate-of-change,价格ChangeRate, from the series of closing stock prices. By default, the volume rate-of-change is calculated between the current closing price and the closing price 12 periods ago.

example

价格ChangeRate= prcroc(___,Name,Value)adds optional name-value pair arguments.

Examples

collapse all

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

loadSimulatedStock.mat价格ChangeRate = prcroc(TMW); plot(PriceChangeRate.Time,PriceChangeRate.PriceRoc) title('Price Rate of Change for TMW')

Input Arguments

collapse all

Data for closing prices, specified as a matrix, table, or timetable. For matrix input,Datais anM-by-1matrix of closing prices. Timetables and tables withMrows must contain a variable named'Close'(case insensitive).

Data Types:double|table|timetable

Name-Value Pair Arguments

Specify optional comma-separated pairs ofName,Valuearguments.Nameis the argument name andValueis the corresponding value.Namemust appear inside quotes. You can specify several name and value pair arguments in any order asName1,Value1,...,NameN,ValueN.

Example:价格ChangeRate = prcroc(TMW,'NumPeriods',18)

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

Data Types:double

Output Arguments

collapse all

Closing price rate-of-change, returned with the same number of rows (M) and the same type (matrix, table, or timetable) as the inputData.

References

[1] Achelis, S. B.Technical Analysis from A to Z.Second Edition. McGraw-Hill, 1995, pp. 243–245.

Introduced before R2006a