|
WebCab Technical Analysis (J2EE Edition) |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
The Stochastics Oscillator compares the closing price with the price over a given period. Here we have implemented a fast %K Stochastic and a general %D Stochastic. The general of the %D Stochastic lies in the fact that the method by which the moving average is evaluated can be selected.
Interpretation and Application
Stochastic Oscillator's produce two time series, %K, and its moving average (MA) usually denoted by %D. These two lines are usual plotted on the same graph since the interaction is generally used in order to determine trading signals.
Below we describe three popular way in which the Stochastic indicator in interpreted in order to produce trading signals:
| Method Summary | |
int |
crossingSignal(double firstStochasticLast,
double firstStochasticPrevious,
double secondStochasticLast,
double secondStochasticPrevious)
Implements a general framework for producing trading signals based on the crossing of two Stochastics. |
double |
dStochastic(double[] stochastic,
int method)
Evaluate the (general) %D Stochastic. |
int |
extremeValueSignal(double extremeLow,
double extremeHigh,
double lastStochastic,
double previousStochastic)
Implements a general framework for producing extreme value trading signals in accordance with the follow. |
double |
kFastStochastic(double[] high,
double[] low,
double close)
Evaluation of the Fast %K Stochastic. |
| Methods inherited from interface javax.ejb.EJBObject |
getEJBHome, getHandle, getPrimaryKey, isIdentical, remove |
| Method Detail |
public double kFastStochastic(double[] high,
double[] low,
double close)
throws RemoteException
Indicator variables
The Stochastic %K depends on the following variable:
Within this method these parameters are set indirectly by the length of the array's which are passed to the method. That is, if the array's have length 5, then the fast Stochastic is evaluated over the last 5 trading period, referred to as the 5-day %K Stochastic.
Now the formulae for the Stochastic %K is:
where the "lowest low" (respec. "highest high") is the highest (respec. lowest) close of the asset over the period under consideration. Since the "Last close", will lie between the highest high and lowest low this indicator will lie between 0 and 100.
high - an array of trading highs during the previous trading sessions. The length of this array corresponds to the number of periods over which the %K Stochastic is evaluated.low - an array of trading lows during the previous trading sessions. The length of this array corresponds to the number of periods over which the %K Stochastic is evaluated.close - the close price of the asset
RemoteException
public double dStochastic(double[] stochastic,
int method)
throws ReferencedServiceException,
RemoteException
As one would expect the Moving Average %D of the %K Stochastic depends on:
Remark When the simple moving average is used and it is evaluated over 3-days, then the %D Stochastic reduces to what is known as the slow %K Stochastic.
stochastic - the value of the stochastic over the period consideredmethod - determines the methods used for the evaluation of the moving average in accordance with the following key: For further details concerning the definition of these moving averages please see the accompanying PDF documentation or the API documentation for MovingAverage.
ReferencedServiceException
RemoteException
public int extremeValueSignal(double extremeLow,
double extremeHigh,
double lastStochastic,
double previousStochastic)
throws RemoteException
Methodology
Buy when the Oscillator (either the Stochastic %K or its moving average %D) falls below a specific level (e.g., 20) and then rises above that level. Sell when the Oscillator rises above a specific level (e.g., 80) and then falls below that level. This approach is the preferred method of the Stochastics original creator George Lane.
extremeLow - this is the level at which the Stochastic is believed to indicate an oversold level. The Stochastic always lies between 0 and 100, and a suggested extreme low value to take is 20.extremeHigh - this is the level at which the Stochastic is believed to indicate an over brought level. The Stochastic always lies between 0 and 100, and a suggested extreme high value is 80.lastStochastic - - This is the last value of the Stochastic (either %K or %D).previousStochastic - - This is the previous value of the Stochastic (either %K or %D)
RemoteException
public int crossingSignal(double firstStochasticLast,
double firstStochasticPrevious,
double secondStochasticLast,
double secondStochasticPrevious)
throws RemoteException
Methodology
Buy when the Stochastic %K, crosses above the MA %D and sell when the Stochastic %K falls below the MA of Stochastic %D. Since this approach is prone to being whip-sawed we use two (general) Stochastics so that a MA of the %K Stochastic of the first Stochastic and an even more smoothed second Stochastic. In this case a sell signal is generated if the first (more sensitive) Stochastic cross below the second (smoothed) Stochastic, and a buy signal is generated if the first Stochastic crosses above the second Stochastic.
firstStochasticLast - - The last value of the first Stochastic. Where the first Stochastic is either the (fast) %K Stochastic or a smoothed moving average of this indicator.firstStochasticPrevious - - The previous value of the first Stochastic.secondStochasticLast - - The last value of the second Stochastic.secondStochasticPrevious - - The previous value of the second Stochastic is a moving average of the first stochastic.
RemoteException
|
WebCab Technical Analysis (J2EE Edition) |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||