|
WebCab Technical Analysis v1.1 (J2SE Edition) |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object | +--webcab.lib.finance.trading.indicators.Aroon
Defines a range of Aroon indicators which were originally developed by Tushar Chande in order to establish whether a price is trending or within a trading range. The Aroon indicator is made up of the Aroon Down indicator and the Aroon Up indicator and together are said to form the Aroon indicator. We also provide the Aroon Oscillator within this component.
The determination of whether a market is trending and within a trading range is a key difficulty is the development of trading systems. The Aroon indicator has been developed in order to indicate when a trending approach such as moving averages or the trading range approach such as the application of oscillators in more appropriate.
Interpretation of the Aroon indicator depends on identifying one of the following three scenarios:
For more information on the Aroon indicator see the article written by Tushar Chande in the September 1995 issue of Technical Analysis of Stocks and Commodities.
For many of the indicators we provide essentially two versions of the same method. The first version evaluates the indicator over the entire period given and the second version evaluates the indicator over all the sub-periods of a given length. Moreover, the version which evaluates over all sub-periods of a given length will return the results as an array where the 1st term of the array will be the value associated with the most resent sub-period, and the previous element corresponding to the previous sub-period and so on.
The naming of these two versions will follow the convention that if the indicator which
evaluates over the entire period and returns a single element is named ABCIndicator,
then the corresponding indicator over all sub-periods (of a given length) which returns
an array will be denoted by ABCIndicatorOverPeriod.
For example, if our source data has N elements then the two versions
of a given indicator, where the number of periods used within the sub-periods is
n would correspond to:
ABCIndicator - Evaluation of the indicator over the whole period of length N.ABCIndicatorOverPeriod - Will return an array where the
first term is the value of the indicator ABCIndicator on the most recent n
periods, and the next term is the value of the indicator ABCIndicator on the
previous n+1 periods minus the most recent period and so on. That is,
for each iterative evaluation 'the window of evaluation' is shifted one place back.
| Constructor Summary | |
Aroon()
Creates a new instance. |
|
| Method Summary | |
double |
aroonDown(double[] lows)
Calculates the Aroon Down indicator which measures the relative time since the last lowest low for all periods for which sufficient data is provided. |
double[] |
aroonDownOverPeriod(double[] lows,
int periods)
Calculates the Aroon Down indicator which measures the relative time since the last lowest low for all periods for which sufficient data is provided. |
double |
aroonOscillator(double[] lows,
double[] highs)
Evaluates the Aroon Oscillator over a period using over price data. |
double |
aroonOscillator(double aroonUpIndicator,
double aroonDownIndicator)
Evaluates the Aroon Oscillator over a given period. |
double[] |
aroonOscillatorOverPeriod(double[] aroonUp,
double[] aroonDown)
Evaluates the Aroon Oscillator over all periods where sufficient historical data is provided. |
double[] |
aroonOscillatorOverPeriod(double[] highs,
double[] lows,
int length)
Evaluates the Aroon Oscillator over all periods where sufficient historical data is provided using only price data. |
double |
aroonUp(double[] highs)
Evaluates the Aroon Up indicator which measures the relative time since the last highest high. |
double[] |
aroonUpOverPeriod(double[] highs,
int period)
Evaluates the Aroon Up indicator which measures the relative time since the last highest high for all periods for which sufficient data is provided. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public Aroon()
| Method Detail |
public double aroonUp(double[] highs)
The Aroon Up indicator is given by:
Aroon Up Indicator = 100 * (n - (number of periods since last highest high over n periods) ) / n,
where n is the number of periods being considered (a reasonable default value for n is 14).
highs - an array of the trading highs over the last n-periods where the k-th terms of the array if the trading high on the k-th previous period.
IllegalArgumentException - thrown if the highs array is empty.aroonUpOverPeriod - this indicator is a generalization of this indicator
and calculates the values of the Aroon Up indicator over all sub-periods of a given
length for all possible periods for which sufficient historical data is provided.
public double[] aroonUpOverPeriod(double[] highs,
int period)
The Aroon Up indicator for each period is given by:
Aroon Up Indicator = 100 * (n - (number of periods since last highest high over n periods) ) / n,
where n is the number of periods being considered (a reasonable default value for
n is 14).
highs - an array where the k-th term is the trading high over the k-th previous period.period - an integer which represents the length of the period over which the indicator will be iteratively evaluated.
period,
and the second term is the value of the indicator over the next set of the consecutive periods
(i.e. the windows is moved one place along), and so on.
IllegalArgumentException - thrown is the highs array is empty, the
array period is not a strictly positive integer or if it
is greater than the length of the array highs.aroonUp - this indicator is a special case of aroonUpOverPeriod
indicator and calculates the Aroon Up indicator for a single period.public double aroonDown(double[] lows)
The Aroon Down indicator is given by:
Aroon Down Indicator = 100 * (n - (number of periods since last highest high over n periods) ) / n,
where n is the number of periods being considered (a reasonable default
value for n is 14).
lows - an array of the trading lows over the last n-periods where the k-th terms of the array if the trading low on the k-th previous period.
IllegalArgumentException - thrown when the lows array is empty.aroonDownOverPeriod - this indicator is a generalization of
{@link #aroonDown aroonDown} indicator and calculates the values of the Aroon Down
indicator over all sub-periods of a given length for all possible periods for which
sufficient historical data is provided.
public double[] aroonDownOverPeriod(double[] lows,
int periods)
The Aroon Down indicator for each period is given by:
Aroon Down Indicator = 100 * (n - (number of periods since last highest high over n periods) ) / n,
where n is the number of periods being considered (a reasonable default value for n is 14).
lows - an array where the first term is the traded high of the asset within the most recent trading period, the second term is the traded high of the asset within the previous period and so on.periods - an integer which represents the length of the period over which the indicator will be iteratively evaluated.
period,
and the second term is the value of the indicator over the next set of the consecutive periods
(i.e. the windows is moved one place along), and so on.
IllegalArgumentException - thrown when the lows array is empty, the
length is not a strictly positive integer or if it
is greater than the length of the array lows.aroonDown - this indicator is a special case of {@link #aroonDownOverPeriod aroonDownOverPeriod}
and calculates the Aroon Down indicator for a single period.
public double aroonOscillator(double aroonUpIndicator,
double aroonDownIndicator)
The Aroon Oscillator over a given period is evaluated using the following formulae:
Aroon Oscillator = (Aroon Up Indicator) - (Aroon Down Indicator),
where 'Aroon Up Indicator' can be evaluated using aroonUp, and
'Aroon Down Indicator' can be evaluated using aroonDown, where the
same number of periods is used in the evaluation of each indicator.
aroonUpIndicator - the value of the Aroon Up Indicator for the period considered which can be evaluated using aroonUparoonDownIndicator - the value of the Aroon Down Indicator for the period considered which can be evaluated using aroonDown
aroonOscillatorOverPeriod - evaluates the Aroon Oscillator over all periods
for which sufficient historical data is provided.
public double[] aroonOscillatorOverPeriod(double[] aroonUp,
double[] aroonDown)
The Aroon Oscillator over each period is evaluated using the following formulae:
Aroon Oscillator = (Aroon Up Indicator) - (Aroon Down Indicator),
where 'Aroon Up Indicator' can be evaluated using aroonUp, and
'Aroon Down Indicator' can be evaluated using aroonDown, where the
same number of periods is used in the evaluation of each indicator.
aroonUp - an array where the first term is the Aroon Up Oscillator over the most recent period, the second term of the oscillator over the previous period and so on. Please note that the value of the Aroon Up Indicator over each period can be evaluated using aroonUp(double[]), alternatively you may evaluate the indicator over all periods using aroonUpOverPeriod.aroonDown - an array where the first term is the Aroon Down indicator over the most recent period, the second term of the Aroon Down indicator over the previous period and so on. Please note that the value of the Aroon Down Indicator over each period can be evaluated using aroonDown(double[]), alternatively you may evaluate the indicator over all periods for the data provided using aroonDownOverPeriod.
IllegalArgumentException - thrown when the array parameters aroonUp and
aroonDown are empty or the lengths of these two arrays are not equal.aroonOscillator
public double aroonOscillator(double[] lows,
double[] highs)
The Aroon Oscillator over each period is evaluated using the following formulae:
Aroon Oscillator = (Aroon Up Indicator) - (Aroon Down Indicator),
where 'Aroon Up Indicator' can be evaluated using aroonUp, and
'Aroon Down Indicator' can be evaluated using aroonDown, where the
same number of periods is used in the evaluation of each indicator.
lows - an array where the first term is the traded low of the asset within the most recent trading period, the second term is the traded low of the asset within the previous period and so on.highs - an array where the first term is the traded high of the asset within the most recent trading period, the second term is the traded high of the asset within the previous period and so on.
IllegalArgumentException - thrown when the array parameters lows and
highs are empty or the lengths of these two arrays are not equal.aroonOscillatorOverPeriod - calculates the values of the
Aroon Oscillator indicator over all sub-periods of a given length.
public double[] aroonOscillatorOverPeriod(double[] highs,
double[] lows,
int length)
The Aroon Oscillator over each period is evaluated using the following formulae:
Aroon Oscillator = (Aroon Up Indicator) - (Aroon Down Indicator),
where the 'Aroon Up Indicator' can be evaluated using aroonUp, and
'Aroon Down Indicator' can be evaluated using aroonDown, where the
same number of periods is used in the evaluation of each indicator. Formally speaking
the Aroon Up and Aroon Down indicators are given by the following formulae.
The Aroon Up indicator is given by:
Aroon Up Indicator = 100 * (n - (number of periods since last highest high over n periods) ) / n,
where n is the number of periods being considered (a reasonable default value for n is 14).
The Aroon Down indicator is given by:
Aroon Down Indicator100 * (n - (number of periods since last highest high over n periods) ) / n.
where n is the number of periods being considered (a reasonable default value for n is 14).
lows - an array where the first term is the traded low of the asset within the most recent trading period, the second term is the traded low of the asset within the previous period and so on.highs - an array where the first term is the traded high of the asset within the most recent trading period, the second term is the traded high of the asset within the previous period and so on.length - an integer which represents the length of the period over which the indicator will be iteratively evaluated.
IllegalArgumentException - thrown when the 'lows' or 'highs' array is empty or not equal, the
length is not a strictly positive integer or if it
is greater than the length of the array lows.
|
WebCab Technical Analysis v1.1 (J2SE Edition) |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||