|
WebCab Technical Analysis (J2EE Edition) |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
Local interface of DirectionalMovementIndicator. This interface provides the same functionality as the DirectionalMovementIndicator remote interface.
DirectionalMovementIndicator| Method Summary | |
double |
averageDailyTrueRange(double[] trueRange)
Method averageDailyTrueRange(double[]) as defined in the DirectionalMovementIndicator remote interface. |
int |
classifyMovements(double todaysHigh,
double todaysLow,
double yesterdaysHigh,
double yesterdaysLow)
Method classifyMovements(double, double, double, double) as defined in the DirectionalMovementIndicator remote interface. |
double |
directionalMotion(double plusDirectionalMovement,
double minusDirectionalMovement)
Method directionalMotion(double, double) as defined in the DirectionalMovementIndicator remote interface. |
double |
directionalMotion(double todaysHigh,
double todaysLow,
double yesterdaysHigh,
double yesterdaysLow,
double yesterdaysClose)
Method directionalMotion(double, double, double, double, double) as defined in the DirectionalMovementIndicator remote interface. |
int |
dmiSignal(double[] pdi,
double[] mdi,
int method)
Method dmiSignal(double[], double[], int) as defined in the DirectionalMovementIndicator remote interface. |
double |
minusDirectionalMovement(double trueRange,
double minusDirectionalMovement)
Method minusDirectionalMovement(double, double) as defined in the DirectionalMovementIndicator remote interface. |
double |
minusDirectionalMovement(double todaysHigh,
double todaysLow,
double yesterdaysHigh,
double yesterdaysLow)
Method minusDirectionalMovement(double, double, double, double) as defined in the DirectionalMovementIndicator remote interface. |
double |
minusDirectionalMovement(double todaysHigh,
double todaysLow,
double yesterdaysHigh,
double yesterdaysLow,
double yesterdaysClose)
Method minusDirectionalMovement(double, double, double, double, double) as defined in the DirectionalMovementIndicator remote interface. |
double |
plusDirectionalMovement(double trueRange,
double positiveDirectionalMovement)
Method plusDirectionalMovement(double, double) as defined in the DirectionalMovementIndicator remote interface. |
double |
plusDirectionalMovement(double todaysHigh,
double todaysLow,
double yesterdaysHigh,
double yesterdaysLow,
double yesterdaysClose)
Method plusDirectionalMovement(double, double, double, double, double) as defined in the DirectionalMovementIndicator remote interface. |
double |
positiveDirectionalMovement(double todaysHigh,
double todaysLow,
double yesterdaysHigh,
double yesterdaysLow)
Method positiveDirectionalMovement(double, double, double, double) as defined in the DirectionalMovementIndicator remote interface. |
double |
trueRange(double todaysHigh,
double todaysLow,
double yesterdaysClose)
Method trueRange(double, double, double) as defined in the DirectionalMovementIndicator remote interface. |
double |
wilderAverageDirectionalMotion(double todaysHigh,
double todaysLow,
double yesterdaysHigh,
double yesterdaysLow,
double yesterdaysClose,
double nDaysHigh,
double nDaysLow,
double yesterdaysNDaysHigh,
double yesterdaysNDaysLow,
double yesterdaysNDaysClose)
Method wilderAverageDirectionalMotion(double, double, double, double, double, double, double, double, double, double) as defined in the DirectionalMovementIndicator remote interface. |
| Methods inherited from interface javax.ejb.EJBLocalObject |
getEJBLocalHome, getPrimaryKey, isIdentical, remove |
| Method Detail |
public int classifyMovements(double todaysHigh,
double todaysLow,
double yesterdaysHigh,
double yesterdaysLow)
Description copied from the DirectionalMovementIndicator interface:
Determines whether todays price action is a day of (up or down) trend, (up or down) gap, or (inner or outer) range type.
This information Will be required by the Directional Movement Indicator (DMI) approach compares the previous days price action to todays price action. In particular, we compare the range of the todays price with yesterdays range of prices and classify the price dynamics according to the following categories:
This method we return a different integer depending on the classification of past two days price action. This integers are defined as:
Remarks:
todaysHigh - the highest traded value which the asset under consideration takes during todays market actiontodaysLow - the lowest traded value which the asset under consideration takes during todays market actionyesterdaysHigh - the highest traded value which the asset under consideration takes during yesterdays market actionyesterdaysLow - the lowest traded value which the asset under consideration takes during yesterdays market action
IllegalArgumentException - thrown if any of the parameters todaysHigh,
todaysLow, yesterdaysHigh or yesterdaysLow is a strictly negative number.DirectionalMovementIndicator.classifyMovements(double, double, double, double)
public double positiveDirectionalMovement(double todaysHigh,
double todaysLow,
double yesterdaysHigh,
double yesterdaysLow)
Description copied from the DirectionalMovementIndicator interface:
Evaluates the Positive Directional Movement (PDM).
todaysHigh - the highest traded value which the asset under consideration takes during todays market actiontodaysLow - the lowest traded value which the asset under consideration takes during todays market actionyesterdaysHigh - the highest traded value which the asset under consideration takes during yesterdays market actionyesterdaysLow - the lowest traded value which the asset under consideration takes during yesterdays market action
IllegalArgumentException - thrown if any of the parameters todaysHigh, todaysLow,
yesterdaysHigh or yesterdaysLow is a strictly negative number.DirectionalMovementIndicator.positiveDirectionalMovement(double, double, double, double)
public double minusDirectionalMovement(double todaysHigh,
double todaysLow,
double yesterdaysHigh,
double yesterdaysLow)
Description copied from the DirectionalMovementIndicator interface:
Evaluates the Minus Directional Movement (MDM).
todaysHigh - the highest traded value which the asset under consideration takes during todays market actiontodaysLow - the lowest traded value which the asset under consideration takes during todays market actionyesterdaysHigh - the highest traded value which the asset under consideration takes during yesterdays market actionyesterdaysLow - the lowest traded value which the asset under consideration takes during yesterdays market action
IllegalArgumentException - thrown if any of the parameters todaysHigh, todaysLow,
yesterdaysHigh or yesterdaysLow is a strictly negative number.DirectionalMovementIndicator.minusDirectionalMovement(double, double, double, double)
public double trueRange(double todaysHigh,
double todaysLow,
double yesterdaysClose)
Description copied from the DirectionalMovementIndicator interface:
Finds the True Range (TR) of a traded asset today. Also, described as the True Range (TR) of the current bar.
todaysHigh - the highest traded value of the asset todaytodaysLow - the lowest traded value of the asset todayyesterdaysClose - the close price of the asset the preceding day
IllegalArgumentException - thrown if any of the parameters todaysHigh, todaysLow
or yesterdaysClose is a strictly negative number.averageDailyTrueRange,
DirectionalMovementIndicator.trueRange(double, double, double)public double averageDailyTrueRange(double[] trueRange)
Description copied from the DirectionalMovementIndicator interface:
We evaluate the x-day Average Daily True Range (ADTR) of an asset over a period. This measure is often used as a measure of volatility. The ADTR is the simple moving average of daily true values.
trueRange - an array of (positive) doubles of length x, where the first element is the true range on the last trading session, the second value of the true range range on the previous trading session and so on.
IllegalArgumentException - thrown if any element of the array is strictly negative.
The elements of the trueRange array cannot be strictly negative since they represent the
(positive) true range's (TRs) of an asset over a period.trueRange,
DirectionalMovementIndicator.averageDailyTrueRange(double[])
public double plusDirectionalMovement(double trueRange,
double positiveDirectionalMovement)
Description copied from the DirectionalMovementIndicator interface:
Calculates the Plus Directional Movement Indicator (DMI) of todays price action.
trueRange - the true range of the Current Bar (i.e. todays)positiveDirectionalMovement - the positive directional movement of the asset over the past day
IllegalArgumentException - thrown if the trueRange is not positive.trueRange,
positiveDirectionalMovement,
DirectionalMovementIndicator.plusDirectionalMovement(double, double)
public double minusDirectionalMovement(double trueRange,
double minusDirectionalMovement)
Description copied from the DirectionalMovementIndicator interface:
Evaluates the Minus Directional Movement Indicator (DMI).
trueRange - the true range of the Current Bar (i.e. todays)minusDirectionalMovement - the minus directional movement of the asset over the past day
IllegalArgumentException - thrown if the trueRange is not positive.trueRange,
minusDirectionalMovement,
DirectionalMovementIndicator.minusDirectionalMovement(double, double)
public double plusDirectionalMovement(double todaysHigh,
double todaysLow,
double yesterdaysHigh,
double yesterdaysLow,
double yesterdaysClose)
Description copied from the DirectionalMovementIndicator interface:
Evaluates the Plus Directional Movement Indicator (DMI).
todaysHigh - the highest traded value which the asset under consideration takes during todays market actiontodaysLow - the lowest traded value which the asset under consideration takes during todays market actionyesterdaysHigh - the highest traded value which the asset under consideration takes during yesterdays market actionyesterdaysLow - the lowest traded value which the asset under consideration takes during yesterdays market actionyesterdaysClose - the close price of the asset the preceding day
IllegalArgumentException - thrown if any of the parameters todaysHigh, todaysLow,
yesterdaysHigh, yesterdaysLow or yesterdaysClose is not a positive number.DirectionalMovementIndicator.plusDirectionalMovement(double, double, double, double, double)
public double minusDirectionalMovement(double todaysHigh,
double todaysLow,
double yesterdaysHigh,
double yesterdaysLow,
double yesterdaysClose)
Description copied from the DirectionalMovementIndicator interface:
Evaluates the Minus Directional Movement Indicator (DMI).
todaysHigh - the highest traded value which the asset under consideration takes during todays market actiontodaysLow - the lowest traded value which the asset under consideration takes during todays market actionyesterdaysHigh - the highest traded value which the asset under consideration takes during yesterdays market actionyesterdaysLow - the lowest traded value which the asset under consideration takes during yesterdays market actionyesterdaysClose - the close price of the asset the preceding day
IllegalArgumentException - thrown if any of the parameters todaysHigh, todaysLow,
yesterdaysHigh, yesterdaysLow or yesterdaysClose is not a positive number.DirectionalMovementIndicator.minusDirectionalMovement(double, double, double, double, double)
public double directionalMotion(double todaysHigh,
double todaysLow,
double yesterdaysHigh,
double yesterdaysLow,
double yesterdaysClose)
Description copied from the DirectionalMovementIndicator interface:
Evaluates the Directional Movement Indicator (DMI). When a trend is moving with strength, the directional indicator (ADX) will measure the strength of the trend by measuring the spread between the Plus directional Indicator (PDI) and Minus Directional Indicator (MDI).
The Directional Movement Indicator (DMI) can be summarized by the following
formula:
((PDM - MDM)/(PDP + MDM)) * 100,
where,
Interpretation
The Directional movement indicator has a range of [0,100], where to higher the value returned the
stronger the trend is said to be. If a trend is reliable then the directional lines
(PDM and MDM) will diverge and the indicator will increase. If on the other hand a trend starts
to fail and price whip-saws (for example with price is within a trading range) the difference
between the direction lines will decrease and the overall index will decrease.
todaysHigh - the highest traded value which the asset under consideration takes during todays market actiontodaysLow - the lowest traded value which the asset under consideration takes during todays market actionyesterdaysHigh - the highest traded value which the asset under consideration takes during yesterdays market actionyesterdaysLow - the lowest traded value which the asset under consideration takes during yesterdays market actionyesterdaysClose - the closing price of the asset the preceding day
IllegalArgumentException - thrown if any of the parameters todaysHigh, todaysLow,
yesterdaysHigh, yesterdaysLow or yesterdaysClose is not a positive number.plusDirectionalMovement,
minusDirectionalMovement,
DirectionalMovementIndicator.directionalMotion(double, double, double, double, double)
public double directionalMotion(double plusDirectionalMovement,
double minusDirectionalMovement)
Description copied from the DirectionalMovementIndicator interface:
Calculates the Directional Indicator forms the main part of the Directional Movement System developed by Wellas Wilder. This indicator is generally evaluated using 14 periods and is used with the plusDirectionalMovement and minusDirectionalMovement indicators.
The directional movement indicator can be summarized by the following formula:
((up - down)/(up+down)) * 100,
where,
Interpretation
The directional indicator has a range of [0,100], where to higher the value returned the
stronger the trend is said to be. If a trend is reliable then the smoothed directional lines
(PDM and MDM) will diverge and the indicator will increase. If on the other hand a trend starts
to fail and price whip-saws (for example with price is within a trading range) the difference
between the smoothed direction lines will decrease and the overall index will decrease.
plusDirectionalMovement - the value of the Plus Directional Movement indicatorminusDirectionalMovement - the value of the Minus Directional Movement indicatorplusDirectionalMovement,
minusDirectionalMovement,
DirectionalMovementIndicator.directionalMotion(double, double)
public int dmiSignal(double[] pdi,
double[] mdi,
int method)
throws ReferencedServiceException
Description copied from the DirectionalMovementIndicator interface:
Evaluates what is know as the Directional Motion Indicator (MDI) Trading Signal. This signal determines whether a given asset or index should be sold, brought or no action should be taken for a given asset under consideration. This trading signal forms the basis of the DMI Trading System which was developed by Welles Wilder.
At its simplest level to DMI system states that when the PDI crosses above the MDI a buy signal is generated and when the MDI crosses above the PMI then a sell signal is generated. This however may generate an excessive number of signals and hence we offer the possibility to smooth out these indicators according to a moving average which will help to reduce to sensitivity of the trading system.
Advantages to this Approach
This trading approach will reveal a trend before it is detected by most market participants. Once the trend becomes more widely recognized other market participants will tend to buy the tend and hence re-enforcing the trend dynamics. Hence the DMI system offers a good risk/reward trend following system.
pdi - an array of the previous values of the positive directional indicator (PDI), where the length of the array is ONE MORE than the number of periods used within the moving average. Where pdi[0] is the latest value of the PDI indicator, pdi[1] is the previous value and so on.mdi - an array of the previous values of the minus directional indicator (MDI), where the length of the array is ONE MORE than the number of periods used within the moving average. Where mdi[0] is the latest value of the MDI indicator, mdi[0] is the previous value and so on.method - an integer which determines the method used in the evaluation of the moving average in accordance with the following key: -1, 0, or 1; according to
whether a sell, no action or buy signal is generated.
ReferencedServiceExceptionDirectionalMovementIndicator.dmiSignal(double[], double[], int)
public double wilderAverageDirectionalMotion(double todaysHigh,
double todaysLow,
double yesterdaysHigh,
double yesterdaysLow,
double yesterdaysClose,
double nDaysHigh,
double nDaysLow,
double yesterdaysNDaysHigh,
double yesterdaysNDaysLow,
double yesterdaysNDaysClose)
Description copied from the DirectionalMovementIndicator interface:
Evaluates the Average Directional Movement Index Rating (ADXR), which is a component of the Directional Movement System developed by Welles Wilder. The ADXR should be considered as a special type of moving average (WilderMA) or or equivalently as a filter which can be applied to the Directional Indicator.
Originally Welles Wilder used the ADXR indicator to determine whether a trend was sufficiently strong enough in order to apply a trend following system. The rule was to only apply a trend following system when the ADXR was between 20 and 25. The ADMR can also be used within a system which uses the Directional Movement Indicator (for example Welles, Directional Movement System) which will result in trading signals being more infrequently generated.
This indicator is given by the following formula:
ADXR = (directionalMotion(today) + directionalMotion(n-days ago))/2
where directionalMotion(today) in the value of the Directional Motion Index (above) today and directionalMotion (n-days ago) is the Directional Motion Index of the asset under consideration n-days ago.
todaysHigh - the highest traded value which the asset under consideration takes during todays market actiontodaysLow - the lowest traded value which the asset under consideration takes during todays market actionyesterdaysHigh - the highest traded value which the asset under consideration takes during yesterdays market actionyesterdaysLow - the lowest traded value which the asset under consideration takes during yesterdays market actionyesterdaysClose - the closing price of the asset the preceding daynDaysHigh - the highest traded value which the asset under consideration takes during the trading period n-days previouslynDaysLow - the lowest traded value which the asset under consideration takes during the trading period n-days previouslyyesterdaysNDaysHigh - the highest traded value which the asset under consideration takes during the trading period (n+1)-days previouslyyesterdaysNDaysLow - the lowest traded value which the asset under consideration takes during the trading period (n+1)-days previouslyyesterdaysNDaysClose - the closing price of the asset on the trading period (n+1) days ago
IllegalArgumentException - thrown if any of the methods double parameters is not
a positive number.DirectionalMovementIndicator.wilderAverageDirectionalMotion(double, double, double, double, double, double, double, double, double, double)
|
WebCab Technical Analysis (J2EE Edition) |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||