PureBytes Links
Trading Reference Links
|
A little bit more technical explanation to explain what confused Mats when
devising the latest TS frog trap:
TradeStation treats prices as signed LONG (32 bits precision), but in fact
LPLONG pointer, a Pricescale ( probably a WORD or INT),and an offset (INT,
16 bits signed integer) from currentbar.
This should be familiar to TS DLL developers.
When TS performs such calculus value1=h+l+h[1], it only use LONG before
doing anything that will put the result into a FLOAT ( variable), uses the
offset for H[1] that is still a pointer to a LONG, then is Pricescale
adjusted.
This is why the 32 bit precision is kept when you perform raw data price
basic + - * operation.
The FLOAT issue precision should only occur when the result has been stored
into a variable or an array element.
When writing
value1=6.800-6.750; the value1 precision is the FLOAT precision already
discussed.
Here you can see the 7th digit error ' 5.000001 for example
IT will NOT give the same results than:
value1= h-h[1] althought h=6.800 and h[1]= 6.750 in the database.
There you will read : 5.000000
This means that the price preciion for calculus done in a row is not an
issue util you override the unsigned LONG precision, until the result is
written into a float variable.
The precision issue occurs once you REUSE the variable, what is not the case
for the DMIplus part of the code.
Sincerely,
Pierre Orphelin
www.sirtrade.com
TradeStation Technologies representative in France
> -----Message d'origine-----
> De : pierre.orphelin [mailto:pierre.orphelin@xxxxxxxxxxxxxx]
> Envoyé : vendredi 3 août 2001 00:59
> À : omega-list@xxxxxxxxxx
> Objet : RE: BEWARE: Pierre still has not understood that DMI is
> incorrect
>
>
>
>
> > -----Message d'origine-----
> > De : Bengtsson, Mats [mailto:mats.bengtsson@xxxxxxxx]
> > Envoyé : jeudi 2 août 2001 23:23
> > À : pierre.orphelin@xxxxxxxxxxxxxx; omega-list@xxxxxxxxxx
> > Objet : RE: BEWARE: Pierre still has not understood that DMI is
> > incorrect
> >
> >
> > Pierre, please be careful, somebody actually might believe you, and they
> > might lose a lot of money from believing you instead of believing in the
> > truth. You have been so much in affect (probably still are) that
> > you do not
> > even remember how this thread came up, and the examples that was in that
> > thread. The error in your reasoning is illustrated by the below code
> > segment, please run it:
> >
> > value1=6.800-6.750;
> > value2=6.600-6.550;
> > if value2>=value1 then
> > print ("value2>value1")
> > else
> > print ("Pierre is still totally wrong and so is the Omega DMI
> > function");
> >
>
> Yes, I see the problem.
> The infamous message appears, but it is wrong
>
> Now, try this ( TS2000):
> ==========================
>
> value1=h+l+h[1];
> value2=2*h+l+o-o-h+h[1];
>
> if value2=value1 then
> messagelog ("value2>value1")
> else
> messagelog ("Pierre is still totally wrong and so is the Omega DMI
> function");
>
> messagelog(value1:5:15," ",value2:5:15);
>
> Of course value1 and value2 are equal, for all price bars
> Can you get get the message telling that I am wrong?
> NOOOOOOOOOOOOOOOOOOOO!
> You cannot!
>
>
>
|