c = 2.220446049250313e-016 //oh dear ...
It's not bad to do floating point calculations, but you have to understand all three links at The == operand. - MQL4 forum
Until then you will still be expecting exact results from floating point. Oh dear. Stop printing them out like that.
double spread = Ask - Bid;
Print( PriceToStr(spread) ); // 0.00021 not 0.00206123456789
// 0.00000 not 0.00000000000001
bool isAtOrAboveTrigger = MathAbs(Bid - trigger) > -_Point/2;
// -0.0000000123456789 > -0.000005
I have read all that a long time ago and i already know how long and convoluted they are, and what do you mean stop printing them out like that ?
Not every calculation is about comparing a price. Some of us work on more complex algorithms in indicators that require a lot of math and floating point calculations.
To add comments, please log in or register