PureBytes Links
Trading Reference Links
|
Did you forget to initialize Dnlss?
----- Original Message -----
From: "Jim Johnson" <jejohn@xxxxxxxxxxx>
To: "Omega List" <omega-list@xxxxxxxxxx>
Sent: Thursday, August 29, 2002 3:12 PM
Subject: division by zero error
> Hello Omega List,
>
> I'm trying to write a version of McClellan Oscillator that uses the
> ratio of Up Volume to Down Volume instead of the difference. This
> code keeps giving a division by zero error--but I can't see it.
> Suggestions? thanks.
>
> {---------------------------}
> { bars above 0 are plotted green and below 0 are plotted red.}
>
> Inputs: UpVol(close of data2), DnVol(close of data3), FstLen(19),
> SlwLen(39);
>
> Vars: McOsc(0);
>
>
> McOsc = IFF(DnVol <> 0, XAverage(UpVol / DnVol, FstLen) -
> XAverage(UpVol / DnIss, SlwLen), 0);
>
>
> If McOsc >= McOsc[1] then
> Plot1(McOsc,"McOsc");
>
> If McOsc < McOsc[1] then
> Plot2(McOsc, "McOsc.");
>
> Plot3(0, "ZLine");
>
> {-----------------------------}
>
>
> --
> Best regards,
> Jim Johnson mailto:jejohn@xxxxxxxxxxx
>
|