| Products & Services | Solutions | Academia | Support | User Community | Company |
| Download Product Updates | | | Get Pricing | | | Trial Software |
| Documentation → Financial Toolbox |
| Contents | Index |
| Learn more about Financial Toolbox |
[spctk, spctd] = spctkd(fastpctk, fastpctd) [spctk, spctd] = spctkd([fastpctk fastpctd]) [spctk, spctd] = spctkd(fastpctk, fastpctd, dperiods, dmamethod) [spctk, spctd] = spctkd([fastpctk fastpctd], dperiods, dmamethod) skdts = spctkd(tsobj) skdts = spctkd(tsobj, dperiods, dmamethod) skdts = spctkd(tsobj, dperiods, dmamethod, ParameterName, ParameterValue, ...)
fastpctk | Fast stochastic F%K (vector). |
fastpctd | 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. |
[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. The inputs must be single column-oriented vectors containing the fast stochastics F%K and F%D.
[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'), triangular ('t'), and modified ('m'). 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) lets you 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
KName: F%K series name
DName: F%D series name
Parameter values are the strings that represent the valid parameter names.
Compute the slow stochastics for Disney stock and plot the results:
load disney.mat
dis_FastStoch = fpctkd(dis);
dis_SlowStoch = spctkd(dis_FastStoch);
plot(dis_SlowStoch)
title('Slow Stochastics for Disney')

Achelis, Steven B., Technical Analysis from A to Z, Second printing, McGraw-Hill, 1995, pp. 268 - 271.
![]() | sortfts | std | ![]() |
View demos and recorded presentations led by industry experts.
Now On Demand
Network with industry peers and learn the latest applications of the leading software product for computational finance.
| © 1984-2009- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |