![MQL5 - Language of trade strategies built-in the MetaTrader 5 client terminal](https://c.mql5.com/i/registerlandings/logo-2.png)
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
Like I mentioned earlier, I'm not outputting to to Print(), unless the Debugger window is the same as Print()? Also, if I compare 64.6 to 64.5999999999999943, will they be the same?
Edit: just tried it out, they are equal.
Be careful with testing doubles for equality. You need an epsilon for that. For example:
double a;
double b;
if ( a == b ) . . .
can give you a nightmare.
Instead, use
if ( a - b < epsilon ) . . .
where epsilon is a small number, like 1E-10.
I seem to recall @nicholi shen's class CDouble does a comparison test for you. There are also rounding functions.
Be careful with testing doubles for equality. You need an epsilon for that. For example:
double a;
double b;
can give you a nightmare.
Instead, use
where epsilon is a small number, like 1E-10.
I seem to recall @nicholi shen's class CDouble does a comparison test for you. There are also rounding functions.
Thanks for the plug ;)... One minor suggestion...
Thanks for the plug ;)... One minor suggestion...