This is simple but I still can't see why.
I'm doing a very simple logic comparison, a double variable against a fraction. For example:
Let's suppose a=0.5, then I do
if ( a>0.4 && a<0.6 )
{
EnterLong(100000, "BUY");
}
under this way the code sends a BUY order, BUT if I do the same comparison like this:
if ( a>4/10 && a<6/10 )
{
EnterLong(100000, "BUY");
}
The code does nothing. Why? and how can I solve it? Despite this problem is easy to solve writing directly, I use a lot fractions, so I´d like to know how.
Thanks
Comment