|
WebCab Technical Analysis (J2EE Edition) |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
Moving Averages in there various forms are used to smooth data so that the underlying trend is more discernible. Since a moving average's aim is to recognize a trending market from historical prices the sensitivity of the measures will depend on the number of a historical values used. For relatively few values used the moving average may itself oscillate rapidly and give many force signals to the start of trending markets. If many values are used fewer force signals will be generated but a trend may in well into its cycle before it is detected and conversely when the trend finishes or changes direction the indicator will take correspondingly longer the reflect this.
With the construction of the moving averages themselves the main significant difference between them is the weight assigned to each price point. Simple moving averages apply equal weight to all historical prices. Exponential and weighted averages apply more weight to recent prices. Triangular averages apply more weight to prices in the middle of the time period and variable moving averages change the weighting based on the volatility of prices.
Interpretation
When the moving average us higher than the asset price then the asset is in a bearish
trend (i.e. trending down) and when the asset is above the moving average then the asset
is in a bullish trend (i.e. trending up-wards).
Moving Averages are also used in pairs and even triples. When using a pair of moving averages of the same type where one moving average uses fewer days and hence is more sensitive, the underlying asset is said to be in bullish mode if the moving average using the fewer number of days crosses above the less sensitive moving average which is using more days data. Conversely, if the less sensitive moving average cross above the more sensitive moving average then asset is said to be in a bearish mode.
All moving averages are lagging indicators and hence will miss the first part of a trend and over-run the same trend. There is also a play-off is the number of historical days use which determines the sensitivity of the indicator.
| Method Summary | |
double |
exponentiallyWeightedMovingAverage(double[] timeSeries,
double smoothingFactor)
We evaluate the Exponentially Weighted Moving Average (EWMA) of a time series from the 0 th period until the t th period. |
double |
geometricMovingAverage(double[] historicalValue)
The Geometric Moving Average (GMA) is the geometric average of the values given over the past x days. |
double |
linearlyWeightedMovingAverage(double[] priceSeries)
This method returns the value of the Linearly Weighted Moving Average (LWMA) of a (finite) price series. |
double |
medianMovingAverage(double[] historicalHigh,
double[] historicalLow)
Returns the Median Moving Average. |
double |
simpleMovingAverage(double[] historicalPrice)
The x-day moving average is the arithmetic average of the market price of a traded asset over the past x-days. |
double |
weightedxDayMovingAverage(double[] historicalPrices,
double[] weights)
Here we evaluate the Weighted Moving Average (WMA) which allows you to assign more significance to resent price dynamics. |
| Methods inherited from interface javax.ejb.EJBObject |
getEJBHome, getHandle, getPrimaryKey, isIdentical, remove |
| Method Detail |
public double simpleMovingAverage(double[] historicalPrice)
throws RemoteException
historicalPrice - an array of length x, where the first element
historicalPrice[0], corresponds to the market price on the first of the
x-day period. The term historicalPrice[1], corresponds to the market
price of the second of the x-day period, and so on...
IllegalArgumentException - thrown if the historicalPrices array is empty.
RemoteException
public double medianMovingAverage(double[] historicalHigh,
double[] historicalLow)
throws RemoteException
historicalHigh - an array where the first element
historicalHigh[0], corresponds to the highest market price during
the last trading period, the historicalHigh[1], corresponds to the
highest market price in the previous period, and so on..historicalLow - an array where the first element
historicalLow[0], corresponds to the lowest market price during
the last trading period, the historicalLow[1], corresponds to the
lowest market price in the previous period, and so on...
IllegalArgumentException - thrown if the arrays historicalHigh and historicalLow
are of different lengths or if one of these arrays is empty.
RemoteException
public double geometricMovingAverage(double[] historicalValue)
throws RemoteException
historicalValue - an array of length x, where the first element
historicalPrice[0], corresponds to the market on the first of the
x-day period. The term historicalPrice[1], corresponds to the market
price of the second of the x-day period, and so on...
IllegalArgumentException - thrown if the historicalValue array is empty.
RemoteException
public double weightedxDayMovingAverage(double[] historicalPrices,
double[] weights)
throws RemoteException
weights - this is an array of length x, which assigns to each of the
historicalPrices a weighting. The ith element weights[i],
assigns to the element historicalPrice[i], a weighting.historicalPrices - an array of length x, where the first element
historicalPrice[0], corresponds to the market on the first of the
x-day period. The term historicalPrice[1], corresponds to the market
price of the second of the x-day period, and so on.
IllegalArgumentException - thrown if the length of the weights and historicalPrices
arrays differ or if either array is empty.
RemoteExceptionxDayMovingAverage
public double linearlyWeightedMovingAverage(double[] priceSeries)
throws RemoteException
priceSeries - an array where the first element is the price on the earliest day, the second element
is the price on the next earliest day and on so.
IllegalArgumentException - thrown if the array priceSeries is empty.
RemoteException
public double exponentiallyWeightedMovingAverage(double[] timeSeries,
double smoothingFactor)
throws RemoteException
timeSeries - an array where the first value corresponds to the value
of the asset in the $t$th period, and the second value corresponds to the value
of the asset in the $t-1$th period and so on
IllegalArgumentException - thrown if the timeSeries is empty or if the value
given for the smoothing factor lies outside the closed range [0,1].
RemoteException
|
WebCab Technical Analysis (J2EE Edition) |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||