Financial Time Series Toolbox | ![]() ![]() |
Syntax
stosc = stochosc(highp, lowp, closep) stosc = stochosc([highp lowp closep]) stosc = stochosc(highp, lowp, closep, kperiods, dperiods, dmamethod) stosc = stochosc([highp lowp closep], kperiods, dperiods, dmamethod) stoscts = stochosc(tsobj, kperiods, dperiods, dmamethod) stoscts = stochosc(tsobj, kperiods, dperiods, dmamethod, ParameterName, ParameterValue, ...)
Arguments
Description
stosc = stochosc(highp, lowp, closep)
calculates the Fast PercentK (F%K) and Fast PercentD (F%D) from the stock price data, highp
(high prices), lowp
(low prices), and closep
(closing prices). stosc
is a two-column matrix whose first column is the F%K values and second is the F%D values.
stosc = stochosc([highp lowp closep])
accepts a three-column matrix of high (highp
), low (lowp
), and closing prices (closep
), in that order.
stosc = stochosc(highp, lowp, closep, kperiods, dperiods,
dmamethod)
calculates the stochastics Fast PercentK (F%K) and Fast PercentD (F%D) from the stock price data, highp
(high prices), lowp
(low prices), and closep
(closing prices). kperiods
sets the %K period. dperiods
sets the %D period. damethod specifies the %D moving average method. Valid moving average methods for %D are exponential ('e'
) and triangular ('t'
). See tsmovavg
for explanations of these methods.
stosc= stochosc([highp lowp closep], kperiods, dperiods, dmamethod)
accepts a three-column matrix of high (highp
), low (lowp
), and closing prices (closep
), in that order.
stoscts = stochosc(tsobj, kperiods, dperiods, dmamethod)
calculates the Fast PercentK (F%K) and Fast PercentD (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). stoscts
is a financial time series object with similar dates to tsobj
and two data series named SOK
and SOD
.
stoscts = stochosc(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). Valid parameter names are
HighName
: high prices series name
LowName
: low prices series name
CloseName
: closing prices series name
Parameter values are the strings that represent the valid parameter names.
Examples
Compute the stochastic oscillator for Disney stock and plot the results:
load disney.mat dis_StochOsc = stochosc(dis) plot(dis_StochOsc) title('Stochastic Oscillator for Disney')
See Also
Reference
Achelis, Steven B., Technical Analysis from A To Z, Second printing, McGraw-Hill, 1995, pp. 268 - 271.
![]() | std | subsasgn | ![]() |