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

Re: Math Error TS 2000



PureBytes Links

Trading Reference Links

You had me worried for a while... Value6 and Value7
are mathematically equal, but the EasyLanguage has an
error in it. Try:

> if CurrentBar = 1 then value99 = MaxBarsBack-1;
> value1 = UpTicks;
> value2 = DownTicks;
> value3 = Volume;
> 
> value4 = value1*value3;
> value5 = value2*value3;
> 
value7 = 0;   {<---CORRECTION HERE}
> value6 = 0;
> For value0 = 0 to value99 begin
>    value6 = value6 + value4[value0]-value5[value0];
>    value7 = value7 +
> value3[value0]*(value1[value0]-value2[value0]);
{<---CORRECTION HERE}
> end;
> Print(value6," ",value7);

No EasyLanguage error here, more like a Baker error...

H

--- Chris Baker <chrisbak@xxxxxxxxx> wrote:
> {This is a simplified example of the "Math error" I
> reported in TS 2000.
> Applied to $NDX (BMI) I get quite different results
> for value6 and value7
> below,
> yet mathematically they are identical.   It does not
> appear to be due to
> Easy Language's restriction of only 6 or 7
> significant digits for variables.
> 
> Upticks, DownTicks and Volume for $NDX usually do
> not exceed 10 so my
> indicator uses
> simple integer arithmetic, where the integers don't
> usually exceed 10.
> 
> This is not my actual indicator, but a simplified
> example.
> I set MaxBarsBack to 12}
> 
> 
> if CurrentBar = 1 then value99 = MaxBarsBack-1;
> value1 = UpTicks;
> value2 = DownTicks;
> value3 = Volume;
> 
> value4 = value1*value3;
> value5 = value2*value3;
> 
> value6 = 0;
> For value0 = 0 to value99 begin
>    value6 = value6 + value4[value0]-value5[value0];
>    value7 = value6 +
> value3[value0]*(value1[value0]-value2[value0]);
> end;
> Print(value6," ",value7);
> 
> 
> ----- Original Message -----
> From: Howard Jackson <hrjf4@xxxxxxxxx>
> To: Chris Baker <chrisbak@xxxxxxxxx>
> Sent: Tuesday, August 10, 1999 8:38 AM
> Subject: Re: Math Error TS 2000
> 
> 
> > Could you be more specific? I have a lot of stuff
> done
> > in EZL and would like to see where you found a
> problem
> > to steer clear of whatever it is.
> 
> 
>