PureBytes Links
Trading Reference Links
|
Hi HHP,
It's an old problem in MS - it calculates all expressions BEFORE checking where IF
condition will take off to. By the way, it results in a huge inefficiency of
explorations, and all other studies in MS. Equis knows about it for a long time,
but prefers to ignore the issue. As for the division error, what I do in similar
situations is like this (taking your formula)
X:= If(H=L, 0, (2*C-H-L) / ( Abs(H-L)+0.000001);
It's up to you how many zeros put into 0.000001 :-) . For prices I'm happy with 5 after
the period.
Cheers, Vitaly
HHP wrote:
> Oh I did it again. Make that line:
>
> X:= If(H=L, 0, (2*C-H-L) / (H-L));
>
> HHP
> =======================
>
> HHP wrote:
> >
> > Chris,
> >
> > It's not only similar, it's identical to MStk's built-in Chaikin's Money
> > Flow Indicator. Plot both in different colours and drag one over the
> > other and they line up exactly. I can confirm that AIQ's Volume
> > Accumulation Percentage has the same formula.
> >
> > When using the hand coded version, if a price bar has a High exactly
> > equal to the Low you get a 'division by zero' error. Has anyone found a
> > way to trap this error? I would expect the following line to do it but
> > it doesn't.
> >
> > X:= If(H=L, 0, (2*C-H-L) / (H-L);
> >
> > HHP
> > ==========================
> >
> > Christian Baude wrote:
> > >
> > > On Sun, 11 Jun 2000 18:53:02 -0400, you wrote:
> > >
> > > > does anyone have the explorer code for this indicator...thanks...
> > > > Jim....Atlanta, GA
> > >
> > > ?? Is this the right VAP ??
> > >
> > > Volume Accumulation Percentage Indicator (VAP) - David Vomund TASC
> > > 10/1999 TASC p.69
> > >
> > > VAP, or VA%, is similar to Chaikin's Money Flow * 100.
> > >
> > > Periods: = Input("Time Periods",1,60,21);
> > > X: = (2*C-H-L) / (H-L);
> > > TVA: = Sum(V*x,Periods);
> > > TV: = Sum(V,Periods);
> > > VA: = 100*TVA/TV;
> > > VA
> > >
> > > -÷ Chris ß ÷-
|