PureBytes Links
Trading Reference Links
|
Your solution how to work around the bug is of course correct, and exactly
what you say is what has to be done. In fact I have already done it where I
have found similar code.
But, and this is the big but: I did not write the code causing the problem.
The code I sent in the mail is part of the DMI calculation delivered by
Omega. That very same code runs in our machines when using built in
accumulators. The problem occurs since Tradestation has a problem with
decimals, a problem greatly exceeding the single precision problem that
could be expected (the same calcualtion in C++ with single precision yields
a correct value). This problem causes DMI to display not only incorrect
values, but values that are incorrect with a factor way beyond what a single
precision calculation would result in since accumulations occur due to the
bug. This since Omegas own indicators does nothing to protect from the
problems in their math engines precision problems.
For all users to get working results, Omega need to either fix the math
problem in Tradestation up to a level of at least single precision, or
change their indicator code to safeguard against incorrect comparisons like
the below.
> -----Original Message-----
> From: ztrader [mailto:ztrader@xxxxxxxxx]
> Sent: den 17 juli 2001 04:48
> To: Bengtsson, Mats
> Cc: Eskimo Omega List
> Subject: Re[2]: Language problems causes bugs not to be
> understood as the bug s they are
>
>
> On Monday, July 16, 2001, 4:15:11 PM, Bengtsson, Mats wrote:
>
> BM> ******************************************
> BM> {Test Indicator, must plot Zero line}
> BM> Value1 = 10.387 - 10.280;
> BM> Value2 = 10.280 - 10.173;
> BM> If Value1 = Value2 Then Value1 = 0;
> BM> plot1 (Value1);
> BM> ******************************************
>
> TS has trouble when two decimal values are compared (Val1 =
> Val2). They are never truly equal if they are calculated from
> other numbers. There are small errors from the precision of
> the computation. A preferred approach is to allow a small
> error in the comparison:
>
> Value3 = .000001 for example, then use:
> if AbsValue (Value1 - Value2) < Value3 Then Value1 = 0;
>
> This allows numbers to be "equal" within some error that will
> always be there.
>
> HTH,
>
> ztrader
>
>
This message contains information that may be privileged or confidential and is the property of the Cap Gemini Ernst & Young Group. It is intended only for the person to whom it is addressed. If you are not the intended recipient, you are not authorized to read, print, retain, copy, disseminate, distribute, or use this message or any part thereof. If you receive this message in error, please notify the sender immediately and delete all copies of this message.
|