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

[GT] perl floating point great-equal bug?



Hello,
    i'm new to this  mailing list, i started using GT at the beginning 
of this year but i didnt realize the project was going on, so i used the 
older version and i modified it a little bit.
Now that i discoved the svn version im switching to it.

One of the things that i changed on the library that seems not corrected 
in the svn version is a little bug using the >= and <= operators in 
floating context.

The problem is that if you create the order using for the price 
($order->price) a division like ($var/100)*100, the $order->price will 
not be exactly $var but $var  0.000....01 (this is a known perl problem)
and the is_executed function could return false if the $order->price is 
equal to the HIGH or the LOW of the bar.

In particular i created 2 functions in Tools.pm and changed all the <= 
and >= with these functions in

Portfolio/Order.pm
is_executed function
lines 372 373 389 394 402 403 408 409

I dont know if this problem is present in other part of GT but i fixed 
only in Order.pm

If someone is interested in the problem i can send  the 
Portfolio/Order.pm and Tools.pm modified.

I hope this is usefull.

PS: im using the http://www.geniustrader.org/wws/compose_mail/devel 
to write this post but i cant attach anything here.Is possible to send a post
from thunderbird?

thx