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

Re: works / doesnot work



PureBytes Links

Trading Reference Links

You could eliminate the rounding error on both programs by using the
following to round the range value prior to the comparison.

StructureChk = ((Round( Range, 2 ) = LittleUp)...


Best regards,

Benjamin "ElGuru" Blanco
http://www.blancofamily.net/elguru

----- Original Message -----
From: "Jon Macmichael" <jonmac@xxxxxxxxxxx>
To: <fritz@xxxxxxxx>
Cc: "omega" <omega-list@xxxxxxxxxx>
Sent: Tuesday, July 16, 2002 9:22 PM
Subject: Re: works / doesnot work


Gary

You're SPOT ON.

I printed LittleUp:3:15 on both TS4 and TS2000i and got 0.010000000000000
and printed Range:2:15 and got 0.010000000000000 on TS4
                                          and 0.010000100000000 on TS2000i

Do you think there could be an error in my '3rd party' Metastock database,
or
as you have said the way TS uses the binary represenation ?

My trust has just gone down 1/2 a notch !

Regards and many thanks for your expert diagnosis.
Jon

----- Original Message -----
From: "Gary Fritz" <fritz@xxxxxxxx>
To: "Jon Macmichael" <jonmac@xxxxxxxxxxx>
Cc: "omega" <omega-list@xxxxxxxxxx>
Sent: Wednesday, 17 July, 2002 8:44 AM
Subject: Re: works / doesnot work


> > I have since been able to 'pick up' that trade by altering the code
from:
> > StructureChk = ((Range = LittleUp).........
> >
> > to:
> > StructureChk = ((Range > LittleUp*0.9 and Range <
LittleUp*1.1)...........
> >
> > The data has LittleUp as exactly 0.01 and I don't understand why
> > this is happening ?
>
> I suspected as much.  No, LittleUp is NOT *exactly* 0.01.  Internally
> it is a binary representation of the decimal value 0.01.  Both TS4
> and TS2k use 32-bit floating point numbers, so in theory it SHOULD
> work the same on both systems.
>
> In TS4 they did some voodoo to only pay attention to part of the
> binary value, or something like that.  Maybe TS2k does it
> differently.  Try printing LittleUp with, say, 10 digits of precision
> on both systems.  Only 7 should be valid, but see if they print
> differently on the two systems.
>
> Gary
>
>