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

RE: [GT] ADX



I don't see that WWMA starts with 0.
okay first it is set to
 my $wwma = 0;
but some lines later it is set to

$wwma = $self->{'args'}->get_arg_values($calc, $i - $nb + 1, 2);

and the loop starts with.

    for(my $n = $i - $nb + 2; $n <= $i; $n++) 

so it starts with price followed by a warmup wilders smoothing of one
period.

If Wilders original version is initialized by a SMA we should stick with
this approach and drop WWMA ... it is not used in any other indicators
and lacks a calculate interval routine anyway.

In general one could state, that Indicator needing a starting value will
be and will stay a bit ambigiuous. One can use a warmup cycle, one could
use a similar indicator as initial guess (SMA for EMA or SMA for Wilders
for instance) or on could start with Price where this is suitable. In
the end you will have to make a decision.


cheers,

Karsten

On Mon, 2008-03-03 at 21:35 -0600, Weigert, Thomas wrote:
> Please see below....
> 
> > -----Original Message-----
> > From: Robert A. Schmied [mailto:ras
AT
acm.org]
> > Sent: Monday, March 03, 2008 6:08 PM
> > To: devel
AT
geniustrader.org
> > Subject: Re: [GT] ADX
> > 
> > tangent on
> > and gee they (wilder and wwma) don't generate the same results -- but
> > that's not too surprising.
> 
> The difference is that WWMA starts with 0 but Wilders starts with the
> n-day SMA (as stated in Wilders article).
> 
> 
> > 
> > is there a (mathematical) way to determine if one is wrong? or are we
> > subject
> > to ta-lib says this, Metastock that ...
> 
> Most of the time, the papers or articles these indicators are based on
> are not very clear on details, e.g., what starting value to use, what
> smoothing functions to use, etc. So implementers often have to make
> these decisions based on their intuitions. Also, there really is no
> right or wrong here... there is no mathematical reason why one should
> use EMA vs. SMA vs. any of the many other smoothing operations.
> 
> > crap -- i'm not too partial to 'dies' in the middle of a program;
> > this one is of the particularly annoying type. but (there's always a
> but)
> > i like the fact that the indicator makes the effort to check it's args
> and
> > report problems. however, when triggered, you get a perfectly
> accurate,
> > but
> > relatively unhelpful message:
> > 'Argument 1 must be a constant value.'
> > 
> > the following info added to the error message would be a big help:
> > @ the module (indicator) that is complaining
> > @ the Argument that is being complained about
> 
> That is a good suggestions. I am planning to add a generic function to
> indicators that would allow some error checking to be done
> automatically.
> 
> 
> Th.