|
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.MarketStrength
A number of indicators including Balance of Power, Market Facilitation Index which measure the relative strength or weakness of the market.
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 recent 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 | |
MarketStrength()
Creates a new instance. |
|
| Method Summary | |
double |
balanceOfPower(double open,
double close,
double high,
double low)
Implements the Balance of Power (BOP) indicator, created by Igor Livshin; which captures the struggle between the Bulls and Bears throughout a trading period. |
double[] |
balanceOfPowerOverPeriod(double[] open,
double[] close,
double[] high,
double[] low)
Evaluates the Balance of Power (BOP) indicator, created by Igor Livshin; which captures the struggle between the Bulls and Bears over a number of trading periods. |
double |
marketFacilitationIndex(double high,
double low,
double volume)
Market Facilitation Index was developed by Dr. Bill Williams and take into consideration the price and volume. |
double[] |
marketFacilitationIndexOverPeriod(double[] high,
double[] low,
double[] volume)
Market Facilitation Index was developed by Dr. Bill Williams and take into consideration the price and volume. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public MarketStrength()
| Method Detail |
public double balanceOfPower(double open,
double close,
double high,
double low)
The BOP indicator for each trading period lies within the range [-1,1].
When the BOP indicator is towards the high if its range it will signifies that the
Bulls are in control, conversely when the indicator is towards the lows of its range
it signifies that the bear are in control. If the indicator move from a high positive
range to a lower positive range it signifies that the buying pressure is decreasing.
Conversely, if the indicator move from a low negative range to a higher negative range
it signifies that the selling pressure is decreasing.
The BOP indicator is evaluated by the following formulae:
BOP = (Close - Open)/(High - Low),
where Close is the periods closing price, Open is the periods opening
price, High is the highest traded price during the period and Low
is the lowest traded price during the period.
open - the opening price of the asset on the trading period under considerationclose - the closing price of the asset on the trading period under considerationhigh - the traded high of the asset on the trading period under considerationlow - the traded low of the asset on the trading period under consideration
balanceOfPowerOverPeriod - a generalization of this indicator
which calculates the values of the Balance Of Power indicator over specified period.
public double[] balanceOfPowerOverPeriod(double[] open,
double[] close,
double[] high,
double[] low)
The BOP indicator for each trading period lies within the range [-1,1].
When the BOP indicator is towards the high if its range it will signifies that the
Bulls are in control, conversely when the indicator is towards the lows of its range
it signifies that the bear are in control. If the indicator move from a high positive
range to a lower positive range it signifies that the buying pressure is decreasing.
Conversely, if the indicator move from a low negative range to a higher negative range
it signifies that the selling pressure is decreasing.
The BOP indicator for each trading periods is evaluated by the following formulae:
BOP = (Close - Open)/(High - Low),
where Close is the periods closing price, Open is the periods opening
price, High is the highest traded price during the period and Low
is the lowest traded price during the period.
high - an array of length equal to the number of periods considered in the indicator evaluation where the first element is the high in the last trading period, the second term is the high in the previous period and so on.low - an array of length equal to the number of periods considered in the indicator evaluation where the first element is the low in the last trading period, the second term is the low in the previous period and so on.open - an array of length equal to the number of periods considered in the indicator evaluation where the first element is the opening price in the last trading period, the second term is the opening price in the previous trading period and so on.close - an array of length equal to the number of periods considered in the indicator evaluation where the first element is the closing price in the last trading period, the second term is the closing price in the previous trading period and so on.
IllegalArgumentException - thrown if any elements from the arrays high, low,
close or open are strictly negative, or if the length of these arrays are not equal.balanceOfPower - evaluates the Balance of Power (BOP) indicator for a single trading period.
public double marketFacilitationIndex(double high,
double low,
double volume)
The formula for the calculation of MFI is:
MFI = (high - low)/volume,
where high is the highest traded price during the period, low
is the lowest traded price during the period and, volume is the overall
volume traded on that period.
There are four types of trading sessions called:
high - the traded high of the asset on the trading period under considerationlow - the traded low of the asset on the trading period under considerationvolume - the traded volume of the asset on the trading period under consideration
marketFacilitationIndexOverPeriod - a generalization
of this indicator which calculates the values of the Market Facilitation Index indicator over
specified period.
public double[] marketFacilitationIndexOverPeriod(double[] high,
double[] low,
double[] volume)
The formula for the calculation of MFI is:
MFI = (high - low)/volume,
where high is the highest traded price during the period, low
is the lowest traded price during the period and, volume is the overall
volume traded on that period.
There are four types of trading sessions called:
high - an array of length equal to the number of periods considered in the indicator evaluation where the first element is the high in the last trading period, the second term is the high in the previous period and so on.low - an array of length equal to the number of periods considered in the indicator evaluation where the first element is the low in the last trading period, the second term is the low in the previous period and so on.volume - an array of length equal to the number of periods considered in the indicator evaluation where the first element is the volume in the last trading period, the second term is the volume in the previous trading period and so on.
IllegalArgumentException - thrown if any elements from the arrays high, low,
volume are strictly negative, or if the length of these arrays are not equal.marketFacilitationIndex - evaluates the Market Facilitation Index (MFI) indicator
for a single trading period.
|
WebCab Technical Analysis v1.1 (J2SE Edition) |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||