[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Lag In Moving Avg



PureBytes Links

Trading Reference Links

What does HP-filter mean?

Can you post a few more instructions to use this for other securities?

In your case does "agent-provocateur" translate as "friendly neighborhood
agitator"? :)

Thanks for your posting.
Lionel Issen
lissen@xxxxxxxxx
----- Original Message -----
From: "Andreas Grau" <agrau@xxxxxxxxxxxxxxxxxxxx>
To: <metastock@xxxxxxxxxxxxx>
Sent: Sunday, February 11, 2001 1:53 AM
Subject: AW: Lag In Moving Avg


List:

I don't know if Jeff is still using the Kalman filter for his graph. If so,
my translation of this filter available here:
www.agent-provocateur.de/hpfilter.xls for the VBA-Code (sorry, no graphing),
and
www.agent-provocateur.de/hpfilter.pdf for the original explanation

The VBA-routines returns an array of data. Formula input differs therefore a
bit from the usual Excel way:

- Mark the return array to receive the resulting data

- enter the formula "=djinhpfilter($H$2:$H$261;$J$1)", where in this example
"$H$2:$H$261" is the input array and "$J$1" is the
smoothing factor

- hit Shift-Ctrl-Return.

If you did it right, the formula will be surrounded by { and } and copied to
the whole return array.

One word of caution: Kalman is not averaging, but smoothing data.
Especially, it goes both directions through the input data, with
the result, that the last few Kalman smoothed data may change as new input
values are added. In some respect, Kalman has to be
treated with the same caution as the Zig-Zag-Indicator.



Good luck,

Andreas


> -----Ursprüngliche Nachricht-----
> Von: owner-metastock@xxxxxxxxxxxxx
> [mailto:owner-metastock@xxxxxxxxxxxxx]Im Auftrag von
> wooglin.org@xxxxxxxxxxx
> Gesendet am: Sonntag, 11. Februar 2001 01:17
> An: metastock@xxxxxxxxxxxxx
> Betreff: Re: Lag In Moving Avg
>
> Jeff:
>
> What I saw on the site was very interesting.
>
> Is it possible to plot this non-linear trend line in MetaStock and, if so,
> would you share the formula? If it is not possible for MetaStock, can it
be
> done in Excel and, if so, would you share the code?
>
> Thanks.
>
>  And to others who responded, the input was clear and concise. A real
> tribute to the talent that is on the list. Thanks,
>
> Jim Barone
>
> ----- Original Message -----
> From: Jeff Haferman <haferman@xxxxxxxxxxxxxxxxxxxxxxx>
> To: <metastock@xxxxxxxxxxxxx>
> Sent: Saturday, February 10, 2001 4:52 PM
> Subject: Re: Lag In Moving Avg
>
>
> >
> > Bob Webb is exactly right, and said it very well.  It's
> > not possible to remove the lag from a moving average.
> >
> > It is possible to draw a non-linear trendline through
> > a time series, and this will give you an idea of
> > the current trend.  Such a trendline doesn't appear
> > to the eye to have the lag associated with an MA.
> >
> > For example, try my "plot" page at
> > http://www.digital-web.net/~haferman/plot.html
> >
> > Enter any U.S. equity symbol, wait about 10 seconds,
> > and you'll get a plot back with a best-fit non-linear
> > trendline.
> >
> > Jeff
> >
> >
> > Bob Webb wrote:
> > >
> > >Jim,
> > >
> > >I think I know what you mean by the question, but when you think about
> it,
> > >it is not possible. A "moving average of X periods" is, by its very
> > >definition, an average of X number of previous prices (O,H,L,C) or some
> > >other value (e.g., see the use of m.a. in the MACD). If price (e.g.,
> Close)
> > >is reversing from being in an upward trend to moving lower, then it
will
> > >take a certain number of Closes, before the moving average of X periods
> > >will begin to also reverse direction. Thus, a moving average is, by
very
> > >definition, a lagging indicator.
> > >
> > >There are, however, two ways (and perhaps more) to decrease (but not
> > >remove) the lag in a moving average:
> > >
> > >(1) make the "X" in a "moving average of X periods" a smaller number.
> Thus
> > >it will take a fewer number of lower Close values to turn the moving
> > >average around.
> > >
> > >(2) give greater weight to the most recent X values and lesser weight
to
> > >the older X values. This is accomplished by using a weighted or
> exponential
> > >moving average.
> > >
> > >The danger, however with using either of these above methods (or a
> > >combination of both), is that you will have a greater number of
whipsaws.
> > >
> > >In conclusion: a moving average is, by definition, a lagging indicator.
> > >There are other indicators that are anticipatory, but not the m.a.
> > >
> > >Hope this helps.
> > >
> > >Bob.
> > >
>