PureBytes Links
Trading Reference Links
|
Would anyone have the following indicator for TS2000i
I cannot get the code to verify in TS2000i
Input: period (Default value 20)
waverage(2*waverage(close,period/2)-waverage(close,period),
SquareRoot(Period))
Gist of it goes like the following:-
Taken from Alan Hull's website at
http://www.justdata.com.au/Journals/AlanHull/hull_ma.htm
Solving the problem of lag is a bit more involved and requires an
explanation with numbers rather than charts. Consider a series of 10 numbers
from '0' to '9' inclusive and imagine that they are successive price points
on a chart with 9 being the most recent price point at the right hand
leading edge. If we take the 10 period simple average of these numbers then,
not surprisingly, we will determine the midpoint of 4.5 which significantly
lags behind the most recent price point of 9. Here's the clever bit.first
let's halve the period of the average to 5 and apply it to the most recent
numbers of 5,6,7,8, and 9, the result being the midpoint of 7.
Finally, to remove the lag we take the midpoint of 7 and add the difference
between the two averages which equals 2.5 (7 - 4.5). This gives a final
answer of 9.5 (7 + 2.5) which is a slight overcompensation. But this
overcompensation is very handy because it offsets the lagging effect of the
nested averaging. Hence the result of combining these 2 techniques is a near
perfect balance between lag reduction and curve smoothing.
0 1 2 3 4 5 6 7 8 9
4.5 7
The HMA manages to keep up with rapid changes in price activity whilst
having superior smoothing over an SMA of the same period. The HMA employs
weighted moving averages and dampens the smoothing effect (and resulting
lag) by using the square root of the period instead of the actual period
itself.as seen below.
Integer(SquareRoot(Period)) WMA [2 xInteger(Period/2) WMA(Price)- Period
WMA(Price)]
Unfortunately the MetaStock version of the indicator requires the 'Integer
part of the square root of the period' to be entered manually as an input.
For example, if the period is 25 then 'sqrtperiod' equals 5 and if the
period is 30 then 'sqrtperiod' also equals 5. ('sqrtperiod' increments up to
6 when period = 36 and so on.)
|