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

RE: Floating point



PureBytes Links

Trading Reference Links



> -----Message d'origine-----
> De : Mark Cerar [mailto:marQc@xxxxxxxxxxx]
> Envoyé : lundi 30 juillet 2001 02:15
> À : Patrick Gamble; Omega-list
> Objet : RE: Floating point
>
>
> It doesn't depend on how many decimal places; it depends on how many
> significant figures there are in the data values.

Yes. We all agree with this.

>
> So for example, doing calculations on a stock under $10.00 will use a
> maximum of 3 to 4 signiciant figues.  Single precision should be adequate
> for that.
>
> What do you do with an index whose data is over the 10,000 pt. range i.e.
> like the DJ Industrials?  That data already uses 7 significant
> figures i.e.
> 10,156.95.  Intermediate calculations can quickly run into the 8, 9, or 10
> figure ranges which get truncated off in single-precision.  Wouldn't you
> like to have reliable calculations when working with index data?

DJA is a special case.

First, you can  easily remove one digit by substracting 10,000 for example

DJ will read  156.95, what is 5 digits
Oscillators should not be affected  by the change in scale ( but you will
have to use  custom versions in some cases).
Add  10000 to the average, Xaverage and this will do the trick

You may substract 9000 if you want, numbers like 1156.95 can be considered
as close to 5 digits precison althought they show 6, but the first one in a
"1".

If you do not agree think 0.999 that has  3 digits.
Add then  0.001 ( three digits too).
Do you  believe that the total, 1.000 ( 4 digits) shows a jump of 1 digit in
precision only by adding two  3 digits number where ther is a change from 0
to 1 in the thousands column? No, it's more complicated when you deal with
jumps from 9 to 10 and  0 to 1
Add 0.001 again . you got 1.001. Does the precision increases in the same
manner? No. But it is the same operation!

The price variation in DJA over weeks do not affect the first two digits, so
the true meaning of the numbers in DJA is only 5, not 7, still compliant
with our 5 digits Ts safe operation. We deal  close to the boundaries, but
yet from inside

This is maybe not very convenient, but a change in scale like this is a
workaround that avoids the use of double only for one index.

And anyway, cou cannot trade it.

I'm annoying, I know.

PO