Main Content

fpctkd

Fast stochastics

fpctkdis not recommended. Usestochoscinstead.

Syntax

[pctk,pctd] = fpctkd(highp,lowp,closep)[pctk,pctd] = fpctkd([highp lowp closep])[pctk,pctd] = fpctkd(highp,lowp,closep,kperiods,dperiods, dmamethod)[pctk,pctd] = fpctkd([highp lowp closep],kperiods,dperiods,dmamethod)pkdts = fpctkd(tsobj,kperiods,dperiods,dmamethod)pkdts = fpctkd(tsobj,kperiods,dperiods,dmamethod,'ParameterName',ParameterValue, ...)

Arguments

highp

High price (vector).

lowp

Low price (vector).

closep

Closing price (vector).

kperiods

(Optional) %K periods. Default =10.

dperiods

(Optional) %D periods. Default =3.

damethod

(Optional) %D moving average method. Default ='e'(exponential).

tsobj

Financial time series object.

'ParameterName'

Valid parameter names are:

  • HighName: high prices series name

  • LowName: low prices series name

  • CloseName: closing prices series name

ParameterValue

Parameter values are the character vectors that represent the valid parameter names.

Description

fpctkdcalculates the stochastic oscillator.

[pctk,pctd] = fpctkd(highp,lowp,closep)calculates the fast stochastics F%K and F%D from the stock price datahighp(high prices),lowp(low prices), andclosep(closing prices).

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

[pctk,pctd] = fpctkd(highp,lowp,closep,kperiods,dperiods,dmamethod)calculates the fast stochastics F%K and F%D from the stock price datahighp(high prices),lowp(low prices), andclosep(closing prices).kperiodssets the %K period.dperiodssets the %D period.

damethodspecifies the %D moving average method. Valid moving average methods for %D are Exponential ('e') and Triangular ('t'). Seetsmovavgfor explanations of these methods.

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

pkdts = fpctkd(tsobj,kperiods,dperiods,dmamethod)calculates the fast stochastics F%K and F%D from the stock price data in the financial time series objecttsobj.tsobjmust minimally contain the seriesHigh(high prices),Low(low prices), andClose(closing prices).pkdtsis a financial time series object with similar dates totsobjand two data series namedPercentKandPercentD.

pkdts = fpctkd(tsobj,kperiods,dperiods,dmamethod,'ParameterName',ParameterValue, ...)accepts parameter name/parameter 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). Parameter values are the character vectors that represent the valid parameter names.

Examples

collapse all

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

loaddisney.mat
警告:不推荐弗林特。使用时间表我nstead. For more information, see Convert Financial Time Series Objects (fints) to Timetables.
dis_FastStoc = fpctkd(dis);
警告:不推荐弗林特。使用时间表我nstead. For more information, see Convert Financial Time Series Objects (fints) to Timetables.
plot(dis_FastStoc)
警告:不推荐弗林特。使用时间表我nstead. For more information, see Convert Financial Time Series Objects (fints) to Timetables.
title('Stochastic Oscillator for Disney')

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

References

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

Introduced before R2006a