[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [GT] WWMA is equivalent to EMA, but broken?
On Sun, 06 Apr 2008 16:08:56 -0700
"Robert A. Schmied" <ras
AT
acm.org> wrote:
> the Wilders.pm code was never committed -- my notes indicate:
> i) the corrected ADX.pm (03/02/08) (also not committed) will need
> change if Wilders.pm name is changed
> ii) similarly, other modules using WWMA.pm might benefit from
> change to Wilders.pm
>
>
> archive messages since first of 2008 that i've found
> discussing welles wilders smoothing include:
> wilders.pm code (sub: wilders smoothing dated 03/02/08)
> some commentary on wilders.pm code and wwma code in the ADX thread
> (sub: ADX dated 03/02/08)
> more discussion in wilders versus wwma thread (sub: wilders versus wwma and adx
> dated 03/17/08)
>
> for what it is worth, if the current wwma.pm is implemented incorrectly
> then the corrected version should replace it. on the other hand, if there are
> significant ambiguities in the interpretation of the welles wilder smoothing algorithm
> that result in (significantly) different implementations across the spectrum of
> technical analysis codes maybe gt should support more than one. but the module
> name should be more descriptive than Wilders.pm.
>
> aloha
>
> ras
>
Robert,
thanks for pointing me to Wilders.pm. It wasn't in the tarball and I
wasn't searching the mailing list for it. Got it now.
EMA.pm, WWMA.pm and Wilders.pm all use the same formula.
WWMA is broken, as for every period, it starts iterating anew from
n periods back. It is taking n for a number of periods and for a
smoothing factor (1/n) simultaniously. Both, however have very
different meanings.
I agree with you regarding the naming. WWMA is probably a good name
to keep for the "Wells Wilders' Moving Average".
So Wilders.pm could become the new WWMA.pm?
There would, however, still be two implementation left for the same
formula, namely EMA and WWMA. The difference being the way the
smoothing factor is treated.
I was thinking of having just one implementation of an
"Exponential Moving Average", e.g. the existing EMA, and have the
new WWMA and possibly others to come, soley be a wrapper around EMA,
passing e.g. n[EMA]=2*n[WWMA]-1 and an initial value method to it?
But this might impact performance, especially for calculate().
Andreas