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

Re: works / doesnot work



PureBytes Links

Trading Reference Links

> 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