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()
- Rick Regan
- www.exploringbinary.com
- 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...;
- 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