# spctkd

Slow stochastics

`spctkd` is not recommended. Use `stochosc` instead.

## Syntax

``[spctd,spctk] = spctkd(fastpctk,fastpctd)``
``[spctd,spctk] = spctkd([fastpctk fastpctd])``
``[spctd,spctk] = spctkd(___,dperiods,dmamethod)``
``skdts = spctkd(tsobj,dperiods,dmamethod)``
``skdts = spctkd(___,Name,Value)``

## Description

example

````[spctd,spctk] = spctkd(fastpctk,fastpctd)` calculates the slow stochastics S%K and S%D. `spctd` and `spctk` 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. ```

example

````[spctd,spctk] = 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.```

example

````[spctd,spctk] = spctkd(___,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 `fastpctd` must contain the fast stochastics, F%K and F%D, in column orientation. `spctk` and `spctd` are column vectors representing the respective slow stochastics.```

example

````skdts = spctkd(tsobj,dperiods,dmamethod)` 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`. ```

example

````skdts = spctkd(___,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 calculate the slow stochastics for Disney stock and plot the results.

`load disney.mat`
```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>. ```
`dis_FastStoch = 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>. ```
`dis_SlowStoch = spctkd(dis_FastStoch);`
```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_SlowStoch)`
```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('Slow Stochastics for Disney')`

## Input Arguments

collapse all

Financial time series object, specified as a `fints` object.

Data Types: `object`

Fast stochastic F%K, specified as a column vector.

Data Types: `double`

Fast stochastic F%D, specified as a column vector.

Data Types: `double`

%D period, specified as a numeric.

Data Types: `double`

%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: ```spcts = spctkd(tsobj,kperiods,dperiods,dmamethod,'KName','KSeries')```

F%K series name, specified as the comma-separated pair consisting of `'KName'` and a character vector with a value for the high prices series name.

Data Types: `char`

D%K series name, specified as the comma-separated pair consisting of `'DName'` and a character vector with a value for the low prices series name.

Data Types: `char`

## Output Arguments

collapse all

Slow stochastics S%D, returned as a column vector.

Slow stochastics S%K, returned as a column vector.

Slow stochastics when using `tsobj` input, returned a `fints` object. 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.

## References

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

## Version History

Introduced before R2006a