Main Content

fpctkd

Fast stochastics

fpctkd is not recommended. Use stochosc instead.

Description

example

pkds = fpctkd(highp,lowp,closep) calculates the fast stochastics F%K and F%D from the stock price data highp (high prices), lowp (low prices), and closep (closing prices).

example

pkds = fpctkd([highp lowp closep]) accepts a three-column matrix of high (highp), low (lowp), and closing prices (closep), in that order.

example

pkds = fpctkd(___,kperiods,dperiods,dmamethod) calculates the fast stochastics F%K and F%D from the stock price data for high (highp), low (lowp), and closing prices (closep). kperiods sets the percent K period. dperiods sets the percent D period. dmamathod specifies the percent D moving average method.

example

pkts = fpctkd(tsobj,kperiods,dperiods,dmamethod) calculates the fast stochastics F%K and F%D from the stock price data in the financial time series object tsobj. tsobj must minimally contain the series High (high prices), Low (low prices), and Close (closing prices).

example

pkts = fpctkd(___,Name,Value) accepts name-value pairs as input. These pairs specify the name(s) for the required data series if it is different from the expected default name(s).

Examples

collapse all

This example shows how to compute the stochastic oscillator for Disney stock and plot the results.

load disney.mat
dis_FastStoc = fpctkd(dis);
Warning: FINTS is not recommended. Use TIMETABLE instead. For more information, see <a href="matlab:web(fullfile(docroot, 'finance/convert-from-fints-to-timetables.html'))">Convert Financial Time Series Objects (fints) to Timetables</a>.
plot(dis_FastStoc)
Warning: FINTS is not recommended. Use TIMETABLE instead. For more information, see <a href="matlab:web(fullfile(docroot, 'finance/convert-from-fints-to-timetables.html'))">Convert Financial Time Series Objects (fints) to Timetables</a>.
title('Stochastic Oscillator for Disney')

Figure contains an axes object. The axes object with title Stochastic Oscillator for Disney contains 2 objects of type line. These objects represent PercentK, PercentD.

Input Arguments

collapse all

Financial time series object, specified as a fints object.

Data Types: object

High prices, specified as a vector.

Data Types: double

Low prices, specified as a vector.

Data Types: double

Closing prices, specified as a vector.

Data Types: double

Percent K period, specified as a numeric.

Data Types: double

Percent D period, specified as a numeric.

Data Types: double

Percent D moving average method, specified as a character vector. See tsmovavg for explanations of these methods.

Data Types: char

Name-Value Arguments

Specify optional pairs of arguments as Name1=Value1,...,NameN=ValueN, where Name is the argument name and Value is the corresponding value. Name-value arguments must appear after other arguments, but the order of the pairs does not matter.

Before R2021a, use commas to separate each name and value, and enclose Name in quotes.

Example: pkds = fpctkd(tsobj,kperiods,dperiods,dmamethod,'HighName','SeriesHigh')

High name, specified as the comma-separated pair consisting of 'HighName' and a character vector with a value for the high prices series name.

Data Types: char

Low name, specified as the comma-separated pair consisting of 'LowName' and a character vector with a value for the low prices series name.

Data Types: char

Close name, specified as the comma-separated pair consisting of 'CloseName' and a character vector with a value for the closing prices series name.

Data Types: char

Output Arguments

collapse all

Fast stochastics, returned a vector.

Fast stochastics when using tsobj input, returned a fints object. pkts is a financial time series object with similar dates to tsobj and two data series named PercentK and PercentD.

References

[1] Achelis, Steven B. Technical Analysis from A to Z. Second Edition. McGraw-Hill, 1995, pp. 268–271.

Version History

Introduced before R2006a