PureBytes Links
Trading Reference Links
|
Hello Jim,
Thursday, August 29, 2002, 11:50:37 PM, you wrote:
JJ> Hello Omega List,
JJ> I typed the code incorrectly in my email but correctly in Power
JJ> Editor. The code verified but gives a "divide by zero' error when
JJ> plotted. Here it is all cleaned up. I tried adding 1 to DnVol but that
JJ> didn't help. I'm having problems with $DVOLQ symbol from Quote.com
JJ> and think that may be the culprit.
JJ> Thanks for the suggestions.
JJ> Inputs: UpVol(close of data2),
JJ> DnVol(close of data3),
JJ> FstLen(19),
JJ> SlwLen(39);
JJ> Vars: McOsc(0);
JJ> McOsc = IFF(DnVol <> 0, XAverage(UpVol / DnVol, FstLen) - XAverage(UpVol / DnVol, SlwLen), 0);
JJ> Plot1(McOsc,"McOsc");
JJ> Plot2(0, "ZLine");
Just try doing your divisions outside the XAverage function,
and calculate each step *separately*. Then you can pinpoint
the problem better. Something like this:
if DnVol<>0 then var1 = UpVol/DnVol else var1 = UpVol;
var2 = XAverage(var1,FstLen);
var3 = XAverage(var1,SlwLen);
McOsc = var2 - var3;
If this does not solve the problem, at least it enables you
to comment out various lines of the code to see what exactly
is causing the problem. Also, often TS has difficulties
when function names are used inside other functions.
Best regards,
Ivo Karindi
ivo@xxxxxxxxx
|