I want check all currency Bid price
NormalizeDouble( MarketInfo(TradePairs[i]+suffix,MODE_BID),MarketInfo(TradePairs[i]+suffix,MODE_DIGITS))
But this code return Wrong bid price For example return result for NZDUSD 0.7273500000000001
You don't need to use NormalizeDouble() if you're using MODE_BID, unless you're doing something strange with the value.
That is the correct result for NormalizeDouble(). It is because of how floating point numbers are stored in binary.
Example:
printf("%.17f",MyVal);
Result: 0.10000000000000001
Just control the output when you want to display the number e.g. DoubleToString()
![Why 0.1 Does Not Exist In Floating-Point Why 0.1 Does Not Exist In Floating-Point](https://c.mql5.com/36/12/why-0-1-does-not-exist-in-floating.png)
- Rick Regan
- www.exploringbinary.com
![Price_Compare Price_Compare](/i/code/library.png)
- votes: 19
- 2016.09.19
- fxsaber
- www.mql5.com
You don't need to use NormalizeDouble() if you're using MODE_BID, unless you're doing something strange with the value.
That is the correct result for NormalizeDouble(). It is because of how floating point numbers are stored in binary.
Example:
printf("%.17f",MyVal);
Result: 0.10000000000000001
Just control the output when you want to display the number e.g. DoubleToString()
mehdi khoshbakhtvash: I want check all currency Bid price
NormalizeDouble( MarketInfo(TradePairs[i]+suffix,MODE_BID),MarketInfo(TradePairs[i]+suffix,MODE_DIGITS)) But this code return Wrong bid price For example return result for NZDUSD 0.7273500000000001 |
|
OrderSend...;
For example
OrderSend...;
![MQL5 - Language of trade strategies built-in the MetaTrader 5 client terminal](https://c.mql5.com/i/registerlandings/logo-2.png)
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
I want check all currency Bid price
NormalizeDouble( MarketInfo(TradePairs[i]+suffix,MODE_BID),MarketInfo(TradePairs[i]+suffix,MODE_DIGITS))
But this code return Wrong bid price For example return result for NZDUSD 0.7273500000000001