Financial Time Series Toolbox    
spctkd

Slow stochastics

Syntax

Arguments

fastpctk
Fast stochastic F%K (vector)
fastpctk
Fast stochastic F%D (vector)
dperiods
(Optional) %D periods. Default = 3.
dmamethod
(Optional) %D moving average method. Default = 'e' (exponential).
tsobj
Financial time series object

Description

[spctk, spctd] = spctkd(fastpctk, fastpctd) calculates the slow stochastics S%K and S%D. spctk and spctd are column vectors representing the respective slow stochastics.

[spctk, spctd] = spctkd([fastpctk fastpctd]) accepts a two-column matrix as input. The first column contains the fast stochastic F%K values, and the second contains the fast stochastic F%D values.

[spctk, spctd] = spctkd(fastpctk, fastpctd, dperiods, dmamethod) calculates the slow stochastics, S%K and S%D, using the value of dperiods to set the number of periods and dmamethod to indicate the moving average method. The inputs fastpctk and fastpctk must contain the fast stochastics, F%K and F%D in column orientation. spctk and spctd are column vectors representing the respective slow stochastics.

Valid moving average methods for %D are exponential ('e') and triangular ('t'). See tsmovavg for explanations of these methods.

[spctk, spctd] = spctkd([fastpctk fastpctd], dperiods, dmamethod) accepts a two-column matrix rather than two separate vectors. The first column contains the F%K values, and the second contains the F%D values.

skdts = spctkd(tsobj) calculates the slow stochastics, S%K and S%D. tsobj must contain the fast stochastics, F%K and F%D, in data series named PercentK and PercentD. The skdts output is a financial time series object with the same dates as tsobj. Within tsobj the two series SlowPctK and SlowPctD represent the respective slow stochastics.

skdts = spctkd(tsobj, dperiods, dmamethod) allows you to specify the length and the method of the moving average used to calculate S%D values.

skdts = spctkd(tsobj, 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). Valid parameter names are

Parameter values are the strings that represent the valid parameter names.

Examples

Compute the slow stochastics for Disney stock and plot the results:

See Also

fpctkd, stochosc, tsmovavg

Reference

Achelis, Steven B., Technical Analysis from A To Z, Second printing, McGraw-Hill, 1995, pp. 268 - 271.


  sortfts std