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

Re: MB Language Wrong?



PureBytes Links

Trading Reference Links

Now, you have a proof more of MB's usual disinformation.

(Funny to se that he refers to Bob Brickey that  he first treated as a fool 4 years ago because he was NN oriented, then adorated  becauseof the TradeLab replacemen, then hated  for the same reason, and callagain when necessary).

Unfortunately, MB does not know of what he speaks.

So you will do the following experience:

Open an indicator and paste the following code ( TS4 build 21, or TS2000i SP2).
Run it on any chart.
Then see what happens.

Did your machine crash ?
No ?
No.
Mine did not too...

So, now you may read the remainder of the message and draw your own conclusions.
The single precision is a false problem for most trading applications ,a nd there are workout as pointed  Bob Brickey in the same message.
Remmeber that you work with price data that have  4 digits, and single precision is far more than what you need in most of the cases.

Here is the code to copy into a blank indicator:
:
========Start here ==========

Vars:X(0),LS1(0),LS2(0),LS(0);
LS1 = 868.90000;
LS   = 869.10000;
LS2 = 968.90000;
X = LS1 - LS;

Value1=LS2-X;

plot1(value1,"dugland");
print(value1);

=======End of code============


Rgds

-Pierre Orphelin
Représentant exclusif de Omega Research en France.
web: http://www.sirtrade.com



-----Message d'origine-----
De : Mark Brown <markbrown@xxxxxxxxxxxxx>
À : Omega List <omega-list@xxxxxxxxxx>
Date : samedi 19 juin 1999 23:56
Objet : Easy Language Math Precision Wrong?


>Read this old post from the TradeLab list to see.
>
>> >Even though it is possible to print more precise-looking numbers on the
>screen, TS4 and TS5 both perform mathematical calculations using what is
>called "Single Precision" in Visual Basic.  Easy Language function arguments
>are passed as Single Precision values.  Results are returned as Single
>Precision values.
>
>James F. Mazzulla asked:
>
>> Thanks for the clarification, Bob. Can you tell us if this is
>=particularly= problematic and, if so, what, if any, course of action needs
>be taken? TIA
>
>It is not problematic.  It is certain.
>
>There is no reasonable way a user can improve Easy Language mathematical
>precision, short of writing high precision mathematical language extensions.
>However, Easy Language program code can be designed to reduce end-result
>errors due to poor mathematical precision in some cases.  There are several
>ways that can be accomplished, depending on the nature of the calculations
>being performed.
>
>That is a very big subject books have been written about.  The methods and
>related considerations are too extensive to explain here, but you will find
>books on the subject in university computer science libraries.  It was an
>especially important topic years ago when most computers had poor
>mathematical precision, so you might find especially interesting ideas in
>books published in the 1960's and 1970's.
>
>  -Bob Brickey
>   Scientific Approaches
>   sci@xxxxxxxxxx
>
>
>Chris Baker wrote:
>
>> Besides single precision, TradeStation 4.0 cannot subtract correctly.
>>
>> Actual example from Easy Language:
>> X = LS1 - LS;
>>
>> Using Print statement:
>> LS1 = 868.90000
>> LS   = 869.10000
>> X = -0.19995100
>>
>> Since X now has 6 significant digits instead of 1, when I subtracted it
>from another variable in the same format as LS and LS1, it lead to a
>TradeStation floating point error which required the server to be restarted.
>
>That error is due only to lack of precision.
>
>   -0.2 = 868.90000 - 869.10000
>
>Easy language returned -0.19995100, which is in error by only:
>
>   -.000049 = -0.2 - (-0.19995100)
>
>  -Bob Brickey
>   Scientific Approaches
>   sci@xxxxxxxxxx
>
>
>